gpt4 book ai didi

bitbucket - 有没有一种方法可以在bitbucket管道中缓存DockerHub镜像?

转载 作者:行者123 更新时间:2023-12-03 13:37:43 24 4
gpt4 key购买 nike

我正在使用来自dockerhub的外部docker镜像。

在每个步骤中,一次又一次地将dockerimage从dockerhub中拉出。是的,这是理想的工作流程。

我的问题是我们可以缓存该镜像,以便它在每个步骤中都不会从dockerhub中拉出吗?此DockerImage不会频繁更改,因为它仅预安装了节点和 meteor 。

那么有可能缓存docker镜像吗?

原始bitbucket-pipeline.yml

image: tasktrain/node-meteor-mup

pipelines:
branches:
'{develop}':
- step:
name: "Client: Install Dependencies"
caches:
- node
script:
- npm install
- npm run setup-meteor-client-bundle
artifacts:
- node_modules/**
- step:
name: "Client: Build for Staging"
script:
- npm run build-browser:stag
artifacts:
- dist/**
- step:
name: "Client: Deploy to Staging"
deployment: staging
script:
- pipe: atlassian/aws-s3-deploy:0.2.2
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: $S3_STAGING_BUCKET_NAME
LOCAL_PATH: 'dist'
ACL: "public-read"
DELETE_FLAG: "true"
EXTRA_ARGS: "--follow-symlinks --quiet"
- step:
name: "Server: Build and Deploy to Staging"
script:
- cd server
- mup setup --config=.deploy/mup-settings.stag.js
- mup deploy --config=.deploy/mup-settings.stag.js --settings=meteor-settings.stag.json

最佳答案

确实可以缓存依赖项,而docker是Bitbucket Pipelines的pre-defined caches之一

pipelines:
default:
- step:
services:
- docker
caches:
- docker
script:
- docker pull my-own-repository:5000/my-image

关于bitbucket - 有没有一种方法可以在bitbucket管道中缓存DockerHub镜像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55284009/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com