Skip to content

Commit 0596154

Browse files
Chore: [AEA-0000] - Adjust devcontainer to support ARM chips (#364)
## Summary - Routine Change ### Details Adjust devcontainer to work with Apple Silicon out of the box. Signed-off-by: Connor Avery <[email protected]>
1 parent 0509c6b commit 0596154

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.devcontainer/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
FROM mcr.microsoft.com/devcontainers/base:ubuntu
22

3+
ARG TARGETARCH
4+
ENV TARGETARCH=${TARGETARCH}
5+
6+
# Add amd64 architecture if on arm64
7+
RUN if [ "$TARGETARCH" == "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then dpkg --add-architecture amd64; fi
8+
39
RUN apt-get update \
410
&& export DEBIAN_FRONTEND=noninteractive \
511
&& apt-get -y dist-upgrade \
@@ -9,14 +15,17 @@ RUN apt-get update \
915
jq apt-transport-https ca-certificates gnupg-agent \
1016
software-properties-common bash-completion python3-pip make libbz2-dev \
1117
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
12-
xz-utils tk-dev liblzma-dev netcat libyaml-dev
13-
14-
# install aws stuff
15-
RUN wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" && \
18+
xz-utils tk-dev liblzma-dev netcat-traditional libyaml-dev
19+
20+
# Download correct AWS CLI for arch
21+
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
22+
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
23+
else \
24+
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"; \
25+
fi && \
1626
unzip /tmp/awscliv2.zip -d /tmp/aws-cli && \
1727
/tmp/aws-cli/aws/install && \
18-
rm tmp/awscliv2.zip && \
19-
rm -rf /tmp/aws-cli
28+
rm /tmp/awscliv2.zip && rm -rf /tmp/aws-cli
2029

2130
USER vscode
2231

0 commit comments

Comments
 (0)