【发布时间】:2019-09-27 15:50:22
【问题描述】:
我正在尝试使用 docker + bitbucket 管道进行自动发布;不幸的是,我有一个问题。我阅读了 Docker Hub 上的管道部署说明,并创建了以下模板:
# This is a sample build configuration for Docker.
# Check our guides at https://confluence.atlassian.com/x/O1toN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: atlassian/default-image:2
pipelines:
default:
- step:
services:
- docker
script: # Modify the commands below to build your repository.
# Set $DOCKER_HUB_USERNAME and $DOCKER_HUB_PASSWORD as environment variables in repository settings
- export IMAGE_NAME=paweltest/tester:$BITBUCKET_COMMIT
# build the Docker image (this will use the Dockerfile in the root of the repo)
- docker build -t paweltest/tester .
# authenticate with the Docker Hub registry
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
# push the new Docker image to the Docker registry
- docker push paweltest/tester:tagname
我已经完成了数据,但是在做push之后,构建开始时出现如下错误:
无法准备上下文:lstat/opt/atlassian/pipelines/agent/build/Dockerfile:没有干文件或目录
我想实现什么?将更改发布到存储库后,我希望自动构建映像并将其发送到 Docker 中心,最好是发送到应用程序所在的目标服务器。
我已经寻找解决方案并尝试了不同的组合。目前,我有大约 200 个提交失败状态并且没有进一步的想法。
【问题讨论】: