This commit is contained in:
parent
a1f357ce6a
commit
cf1c041db5
@ -20,11 +20,19 @@ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
function pull_target {
|
||||
target=$1
|
||||
echo "pulling $target"
|
||||
latest_target_tag="$base_tag-$target:latest"
|
||||
|
||||
docker pull $latest_target_tag
|
||||
}
|
||||
|
||||
function build_target {
|
||||
target=$1
|
||||
echo "building $target"
|
||||
latest_target_tag="$base_tag-$target:latest"
|
||||
docker pull $latest_target_tag
|
||||
|
||||
docker build \
|
||||
--target "$target" \
|
||||
--tag "$latest_target_tag" \
|
||||
@ -33,6 +41,10 @@ function build_target {
|
||||
--file "$TMP/build_release.Dockerfile" .
|
||||
}
|
||||
|
||||
pull_target "deps" &
|
||||
pull_target "builder" &
|
||||
wait
|
||||
|
||||
build_target "deps"
|
||||
build_target "builder"
|
||||
|
||||
|
@ -20,16 +20,21 @@ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
function build_target {
|
||||
function push_target {
|
||||
target=$1
|
||||
echo "building $target"
|
||||
echo "pushing $target"
|
||||
latest_target_tag="$base_tag-$target:latest"
|
||||
docker push "$latest_target_tag"
|
||||
}
|
||||
|
||||
build_target "deps"
|
||||
build_target "builder"
|
||||
function push_main_target {
|
||||
echo "docker: pushing image $tag"
|
||||
docker push "$tag"
|
||||
docker push "$latest_tag"
|
||||
}
|
||||
|
||||
push_target "deps" &
|
||||
push_target "builder" &
|
||||
push_main_target &
|
||||
wait
|
||||
|
||||
echo "docker: pushing image $tag"
|
||||
docker push "$tag"
|
||||
docker push "$latest_tag"
|
||||
|
Loading…
Reference in New Issue
Block a user