Skip to content

Commit

Permalink
Adding the platform option without adding a breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
dothomson committed Apr 17, 2024
1 parent 66b01b7 commit 5930153
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inputs:
docker-platform:
description: The target architecture for the image build
required: false
default: "linux/amd64"
default: ""
checkout-repo:
description: Checks out the repo as the first step of the action. Default "true".
required: false
Expand Down
11 changes: 10 additions & 1 deletion scripts/build-tag-push-ecr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ fi

echo "Building image"

PLATFORM_OPTION=""

if [ -n "${DOCKER_PLATFORM}" ]; then
echo "Using platform option as --platform ${DOCKER_PLATFORM}"
PLATFORM_OPTION="--platform ${DOCKER_PLATFORM}"
else
echo "No platform option supplied, using defaults."
fi

docker build \
--tag "$ECR_REGISTRY/$ECR_REPO_NAME:$GITHUB_SHA" \
--platform "${DOCKER_PLATFORM}" \
$PLATFORM_OPTION \
--file "$DOCKER_BUILD_PATH"/"$DOCKERFILE" \
"$DOCKER_BUILD_PATH"

Expand Down

0 comments on commit 5930153

Please sign in to comment.