Skip to content

Commit

Permalink
Add docker_buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
vitr committed Aug 1, 2023
1 parent 7c7cb62 commit 39cc1ff
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function main() {

aws_configure
login
docker_build $INPUT_TAGS $ACCOUNT_URL
docker_buildx $INPUT_TAGS $ACCOUNT_URL
create_ecr_repo $INPUT_CREATE_REPO
docker_push_to_ecr $INPUT_TAGS $ACCOUNT_URL
}
Expand Down Expand Up @@ -59,6 +59,22 @@ function docker_build() {
echo "== FINISHED DOCKERIZE"
}

function docker_buildx() {
echo "== START DOCKERIZE WITH BUILDX"
local TAG=$1
local docker_tag_args=""
local DOCKER_TAGS=$(echo "$TAG" | tr "," "\n")
for tag in $DOCKER_TAGS; do
docker_tag_args="$docker_tag_args -t $2/$INPUT_REPO:$tag"
done

docker buildx build $INPUT_EXTRA_BUILD_ARGS -f $INPUT_DOCKERFILE $docker_tag_args \
--cache-to type=gha,max \
--cache-from type=gha \
$INPUT_PATH
echo "== FINISHED DOCKERIZE BUILDX"
}

function docker_push_to_ecr() {
echo "== START PUSH TO ECR"
local TAG=$1
Expand Down

0 comments on commit 39cc1ff

Please sign in to comment.