Skip to content

Commit

Permalink
Skip pulling step when BuildKit is enabled as it's done during build
Browse files Browse the repository at this point in the history
  • Loading branch information
whoan committed Oct 22, 2023
1 parent 71c3e3c commit b10312e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ _is_aws_ecr_public() {
[[ "$INPUT_REGISTRY" =~ ^public.ecr.aws$ ]]
}

_buildkit_is_enabled() {
[[ "$DOCKER_BUILDKIT" != 0 ]]
}

_get_aws_region() {
_is_aws_ecr_public && echo "us-east-1" && return
# tied to _is_aws_ecr_private implementation
Expand Down Expand Up @@ -329,6 +333,10 @@ pull_cached_stages() {
if [ "$INPUT_PULL_IMAGE_AND_STAGES" != true ]; then
return
fi
# cache importing/exporting is done in build statement when BuildKit is enabled
if _buildkit_is_enabled; then
return
fi
echo -e "\n[Action Step] Pulling image..."

if _is_aws_ecr_public; then
Expand Down Expand Up @@ -393,10 +401,6 @@ _build_image_buildkit() {
"${INPUT_CONTEXT}"
}

_buildkit_is_enabled() {
! [[ "$DOCKER_BUILDKIT" == 0 ]]
}

build_image() {
if _buildkit_is_enabled; then
_build_image_buildkit
Expand Down

0 comments on commit b10312e

Please sign in to comment.