Skip to content

Commit accee98

Browse files
committed
correct dev container
1 parent be59973 commit accee98

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

.devcontainer/Dockerfile

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

3+
4+
ARG TARGETARCH
5+
ENV TARGETARCH=${TARGETARCH}
6+
7+
ARG ASDF_VERSION
8+
COPY .tool-versions.asdf /tmp/.tool-versions.asdf
9+
310
RUN apt-get update \
411
&& export DEBIAN_FRONTEND=noninteractive \
512
&& apt-get -y dist-upgrade \
@@ -11,14 +18,39 @@ RUN apt-get update \
1118
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
1219
xz-utils tk-dev liblzma-dev netcat-traditional libyaml-dev
1320

14-
USER vscode
21+
# Download correct AWS CLI for arch
22+
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
23+
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
24+
else \
25+
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"; \
26+
fi && \
27+
unzip /tmp/awscliv2.zip -d /tmp/aws-cli && \
28+
/tmp/aws-cli/aws/install && \
29+
rm /tmp/awscliv2.zip && rm -rf /tmp/aws-cli
30+
31+
# Download correct SAM CLI for arch
32+
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
33+
wget -O /tmp/aws-sam-cli.zip "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-arm64.zip"; \
34+
else \
35+
wget -O /tmp/aws-sam-cli.zip "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip"; \
36+
fi && \
37+
unzip /tmp/aws-sam-cli.zip -d /tmp/aws-sam-cli && \
38+
/tmp/aws-sam-cli/install && \
39+
rm /tmp/aws-sam-cli.zip && rm -rf /tmp/aws-sam-cli
1540

1641
# Install ASDF
17-
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3; \
18-
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc; \
19-
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc;
42+
RUN ASDF_VERSION=$(awk '!/^#/ && NF {print $1; exit}' /tmp/.tool-versions.asdf) && \
43+
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
44+
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-arm64.tar.gz; \
45+
else \
46+
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-amd64.tar.gz; \
47+
fi && \
48+
tar -xvzf /tmp/asdf.tar.gz && \
49+
mv asdf /usr/bin
50+
51+
USER vscode
2052

21-
ENV PATH="$PATH:/home/vscode/.asdf/bin/:/workspaces/eps-prescription-tracker-ui/node_modules/.bin:/workspaces/eps-workflow-quality-checks/.venv/bin"
53+
ENV PATH="$PATH:/home/vscode/.asdf/shims/:/workspaces/eps-prescription-tracker-ui/node_modules/.bin:/workspaces/eps-workflow-quality-checks/.venv/bin"
2254

2355
# Install ASDF plugins#
2456
RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git; \
@@ -33,5 +65,4 @@ ADD .tool-versions /workspaces/eps-workflow-quality-checks/.tool-versions
3365
ADD .tool-versions /home/vscode/.tool-versions
3466

3567
RUN asdf install python; \
36-
asdf install; \
37-
asdf reshim nodejs;
68+
asdf install;

0 commit comments

Comments
 (0)