drone利用docker构建.net webapi 找不到SDK

docker file 文件

FROM registry.cn-hangzhou.aliyuncs.com/yoyosoft/dotnet/core/aspnet:3.1
COPY src/YOGA.MIniProgram.API/dist /app
WORKDIR /app
EXPOSE 5000
RUN echo "PWD is: $PWD"
RUN  ls
ENTRYPOINT ["dotnet", "app/06.YOGA.MIniProgram.API.dll"]

entrypoint不写 app/也找不到。
RUN ls 后的目录

图片说明

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
    - echo 商户后台发布成功
    - dotnet publish  src/YOGA.MIniProgram.API --framework netcoreapp3.1 --configuration Release --output src/YOGA.MIniProgram.API/dist
    - echo 小程序后台发布成功
    - echo "$(pwd)"
    - ls
    - cd src
    - ls
    - cd YOGA.Api
    - ls

- name: xxx
  image: plugins/docker
  settings:
    dockerfile: src/xxx.Api/Dockerfile
    tags: latest
    insecure: true
    registry: "registry.cn-qingdao.aliyuncs.com"
    repo: "registry.cn-qingdao.aliyuncs.com/yoga_images/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: xxxxx
    port: 22
    username: xxxxx
    password:xxxxxxx
    script:
      - echo start deploy- echo pulling images from  AliyunHub 
      - docker login --username=xxx registry.cn-qingdao.aliyuncs.com --password=xxx
      - docker stop mrt-api
      - docker rm mrt-api
      - docker stop mrt-mini-api
      - docker rm mrt-mini-api
      - docker pull registry.cn-qingdao.aliyuncs.com/yoga_images/mini_mrt_backend_api:latest
      - docker tag mini_mrt_backend_api mini-mrt-api:latest
      - docker run --name mrt-mini-api -d -p xxxxxx:80 mini-mrt-api
      - echo docker容器mini-mrt启动成功
      - docker pull registry.cn-qingdao.aliyuncs.com/yoga_images/mrt_backend_api:latest
      - docker tag mrt_backend_api mrt-api:latest
      - docker run --name mrt-api -d -p xxxx:5000 mrt-api
      - echo docker容器mrt-api启动成功

docker logs

图片说明

不清楚为什么会出现这个问题,请帮帮忙

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问