Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build_push_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ if [[ -z "${STACK_PREFIX}" ]]; then
read -rp 'STACK_PREFIX: ' STACK_PREFIX
fi

AWS_ACCOUNT_ID=$(get_account_id $AWS_PROFILE)
AWS_ACCOUNT_ID=$(get_account_id)

if [[ $(uname -m) == arm64* ]]; then
Comment thread
camposeddie marked this conversation as resolved.
docker_build="docker buildx build --load --platform linux/amd64 -t"
else
docker_build="docker build -t"
fi

docker build -t ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/$REPO_NAME .
${docker_build} ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/$REPO_NAME .
check_exit

create_ecr_repo_or_skip $AWS_ACCOUNT_ID $STACK_PREFIX
Expand Down
3 changes: 1 addition & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ function create_ecr_repo_or_skip() {
}

function get_account_id() {
# $1 AWS_PROFILE
echo $(aws sts get-caller-identity --query Account --profile $1 | tr -d '"')
echo $(aws sts get-caller-identity --query Account $ADD_PROFILE | tr -d '"')
}

function stop_mdx_task() {
Expand Down