Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Docker build for ARM64 architecture on MacOS (M1/M2). #675

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 7 additions & 4 deletions ubuntu/standard/7.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
FROM public.ecr.aws/ubuntu/ubuntu:22.04 AS core

ARG DEBIAN_FRONTEND="noninteractive"
ARG BUILDARCH

# Install git, SSH, and other utilities
RUN set -ex \
Expand Down Expand Up @@ -87,13 +88,15 @@ RUN curl -sS -o /usr/local/bin/aws-iam-authenticator https://s3.us-west-2.amazon
RUN set -ex \
&& mkdir /tmp/ssm \
&& cd /tmp/ssm \
&& wget -q https://s3.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb \
&& wget -q https://s3.amazonaws.com/amazon-ssm-us-east-1/latest/debian_$BUILDARCH/amazon-ssm-agent.deb \
&& dpkg -i amazon-ssm-agent.deb

# Install AWS CLI v2
# https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html
RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o /tmp/awscliv2.zip \
&& unzip -q /tmp/awscliv2.zip -d /opt \
RUN [ "$BUILDARCH" = "arm64" ] \
&& curl https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip -o /tmp/awscliv2.zip \
|| curl https://awscli.amazonaws.com/awscli-exe-linux-$BUILDARCH.zip -o /tmp/awscliv2.zip \
&& unzip -q /tmp/awscliv2.zip -d /opt \
&& /opt/aws/install --update -i /usr/local/aws-cli -b /usr/local/bin \
&& rm /tmp/awscliv2.zip \
&& rm -rf /opt/aws \
Expand Down Expand Up @@ -275,7 +278,7 @@ RUN set -ex \
&& apt-get install -y -qq --no-install-recommends ca-certificates-java \
# Ensure Java cacerts symlink points to valid location
&& update-ca-certificates -f \
&& dpkg --add-architecture i386 \
&& dpkg --add-architecture $BUILDARCH \
&& apt-get update \
&& for tool_path in $JAVA_HOME/bin/*; do \
tool=`basename $tool_path`; \
Expand Down