我使用的是.NET Core 3.1。使用无人机进行C/D。
我的.drone.yml是
kind: pipeline
type: docker
name: deployment
steps:
- name: build
image: registry.cn-hangzhou.aliyuncs.com/yoyosoft/dotnet/core/sdk
commands:
- dotnet restore src/YOGA.Api
- dotnet restore src/YOGA.MIniProgram.API
- dotnet publish src/YOGA.Api --framework netcoreapp3.1 --configuration Release --output src/YOGA.Api/dist
- dotnet publish src/YOGA.MIniProgram.API --framework netcoreapp3.1 --configuration Release --output src/YOGA.MIniProgram.API/dist
- echo "$(pwd)"
- ls
- cd src
- ls
- cd YOGA.Api
- ls
- name: YOGA.Api to AliyunHub
image: plugins/docker
settings:
dockerfile: src/YOGA.Api/Dockerfile
tags: latest
insecure: true
registry: "registry.cn-qingdao.aliyuncs.com"
repo: "registry.cn-qingdao.aliyuncs.com/yoga_images/mrt_backend_api/mrt_backend_api"
username:
from_secret: username
password:
from_secret: userpassword
- name: YOGA.Mini to AliyunHub
image: plugins/docker
settings:
dockerfile: src/YOGA.MIniProgram.API/Dockerfile
tags: latest
insecure: true
registry: "registry.cn-qingdao.aliyuncs.com"
repo: "registry.cn-qingdao.aliyuncs.com/yoga_images/mini_mrt_backend_api"
username:
from_secret: username
password:
from_secret: userpassword
- name: deploy
image: appleboy/drone-ssh
pull: true
settings:
host: ...
port: ...
username: ...
password: ...
script:
- echo start deploy- echo pulling images from AliyunHub
- docker login --username=...registry.cn-qingdao.aliyuncs.com --password=...
- docker pull docker pull registry.cn-qingdao.aliyuncs.com/yoga_images/mini_mrt_backend_api:latest
- docker tag registry.cn-qingdao.aliyuncs.com/yoga_images/mini_mrt_backend_api:latest mini-mrt-api:latest
- docker run --name mrt-mini-api -d -p xxx:80 mini-mrt-api
- docker pull registry.cn-qingdao.aliyuncs.com/yoga_images/mrt_backend_api:latest
- docker tag registry.cn-qingdao.aliyuncs.com/yoga_images/mrt_backend_api:latest mrt-api:latest
- docker run --name mrt-api -d -p xxx:5000 mrt-api
无人机运行良好。这是我的码头文件,看起来很像。。。
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
RUN echo "PWD is: $PWD"
COPY src/YOGA.Api/dist /app
WORKDIR /app
EXPOSE 5000
ENTRYPOINT ["dotnet","YOGA.Api.dll"]
以下是ls命令的输出在此处输入图像描述
一切看起来都很好。
无人机完成后,集装箱不会启动,
这是docker日志中的错误。。。
docker logs 57c728d627cd
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
有人知道解决方案吗?
thx大量
它工作于
我正在向存储库推送失败。