drone 如何构建 Dockerfile 并在宿主机启动容器?

目录结构:

- Dockerfile
- .drone.yml

我尝试以下配置但不起作用:

# .drone.yml

kind: pipeline
type: exec
name: deploy

platform:
  os: linux
  arch: amd64

steps:
  - name: build
    commands:
      - docker build  -t xxxxxxxx .
      - if [ $(docker ps -aq --filter name=xxxxxxxx) ];then docker rm -f xxxxxxxx;fi
      - docker run -d --restart always -p 3000:80 --name xxxxxxxx xxxxxxxx

请问如何才能达到预期效果呢?

阅读 2.4k
1 个回答

Drone是基于容器环境的一个CI/CD工具,也就是说中间生成的产物也是放在容器里的,之后你可以通过push到镜像仓库,在宿主机pull,然后 docker run .....

你提的问题本身就有问题,建议细品官方仓库的第一句话:What is Drone?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题