bitbucket 管道中的 docker 容器出现错误
我正在使用 bitbucket 管道部署我的 dockerized Django 应用程序,但不幸的是,管道已经创建了两个容器,但不是最后一个容器,错误和我的文件附在下面。
错误
ERROR: for db Cannot create container for service db: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories
Encountered errors while bringing up the project.
docker-compose.yml
version: "3.8"
services:
db:
container_name: db
image: "postgres"
restart: always
volumes:
- postgres-data:/var/lib/postgresql/data/
app:
container_name: app
build:
context: .
restart: always
volumes:
- static-data:/vol/web
depends_on:
- db
proxy:
container_name: proxy
build:
context: ./proxy
restart: always
depends_on:
- app
ports:
- 80:8000
volumes:
- static-data:/vol/static
volumes:
postgres-data:
static-data:
bitbucket-pipelines.yml
image: python:3.7.2
pipelines:
default:
- step:
services:
- docker
caches:
- docker
- pip
script:
- pip install docker-compose
- docker-compose -f docker-compose-deploy.yml up --build
- pipe: atlassian/aws-code-deploy:0.2.5
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
COMMAND: 'upload'
APPLICATION_NAME: $APPLICATION_NAME
ZIP_FILE: 'application.zip'
S3_BUCKET: $S3_BUCKET
VERSION_LABEL: 'my-app-2.0.0'
- pipe: atlassian/aws-code-deploy:0.2.5
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
COMMAND: 'deploy'
APPLICATION_NAME: $APPLICATION_NAME
DEPLOYMENT_GROUP: $DEPLOYMENT_GROUP
WAIT: 'true'
S3_BUCKET: $S3_BUCKET
VERSION_LABEL: 'my-app-2.0.0'
IGNORE_APPLICATION_STOP_FAILURES: 'true'
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
definitions:
services:
docker:
memory: 3072
``
I'm deploying my dockerized Django app using bitbucket pipelines but unfortunately, the pipeline already creates two containers but not the last one the error and my files are attached below.
error
ERROR: for db Cannot create container for service db: authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories
Encountered errors while bringing up the project.
docker-compose.yml
version: "3.8"
services:
db:
container_name: db
image: "postgres"
restart: always
volumes:
- postgres-data:/var/lib/postgresql/data/
app:
container_name: app
build:
context: .
restart: always
volumes:
- static-data:/vol/web
depends_on:
- db
proxy:
container_name: proxy
build:
context: ./proxy
restart: always
depends_on:
- app
ports:
- 80:8000
volumes:
- static-data:/vol/static
volumes:
postgres-data:
static-data:
bitbucket-pipelines.yml
image: python:3.7.2
pipelines:
default:
- step:
services:
- docker
caches:
- docker
- pip
script:
- pip install docker-compose
- docker-compose -f docker-compose-deploy.yml up --build
- pipe: atlassian/aws-code-deploy:0.2.5
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
COMMAND: 'upload'
APPLICATION_NAME: $APPLICATION_NAME
ZIP_FILE: 'application.zip'
S3_BUCKET: $S3_BUCKET
VERSION_LABEL: 'my-app-2.0.0'
- pipe: atlassian/aws-code-deploy:0.2.5
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
COMMAND: 'deploy'
APPLICATION_NAME: $APPLICATION_NAME
DEPLOYMENT_GROUP: $DEPLOYMENT_GROUP
WAIT: 'true'
S3_BUCKET: $S3_BUCKET
VERSION_LABEL: 'my-app-2.0.0'
IGNORE_APPLICATION_STOP_FAILURES: 'true'
FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
definitions:
services:
docker:
memory: 3072
``
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论