Skip to content

Commit 4397c19

Browse files
authored
Chore: [AEA-0000] - install asdf in devcontainer (#512)
## Summary - 🤖 Operational or Infrastructure Change ### Details Install asdf in devcontainer
1 parent 10a4cd3 commit 4397c19

File tree

2 files changed

+41
-27
lines changed

2 files changed

+41
-27
lines changed

.devcontainer/Dockerfile

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,50 +15,63 @@ RUN mkdir -p /tmp && chmod 1777 /tmp
1515

1616
# Install system dependencies
1717
RUN apt-get update \
18-
&& export DEBIAN_FRONTEND=noninteractive \
19-
&& apt-get -y dist-upgrade \
20-
&& apt-get -y install --no-install-recommends htop vim curl git build-essential \
21-
libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev libbz2-dev \
22-
zlib1g-dev unixodbc unixodbc-dev libsecret-1-0 libsecret-1-dev libsqlite3-dev \
23-
openjdk-8-jdk jq apt-transport-https ca-certificates gnupg-agent \
24-
software-properties-common bash-completion python3-pip make \
25-
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
26-
xz-utils tk-dev liblzma-dev netcat-traditional libyaml-dev
18+
&& export DEBIAN_FRONTEND=noninteractive \
19+
&& apt-get -y dist-upgrade \
20+
&& apt-get -y install --no-install-recommends htop vim curl git build-essential \
21+
libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev libbz2-dev \
22+
zlib1g-dev unixodbc unixodbc-dev libsecret-1-0 libsecret-1-dev libsqlite3-dev \
23+
openjdk-8-jdk jq apt-transport-https ca-certificates gnupg-agent \
24+
software-properties-common bash-completion python3-pip make \
25+
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
26+
xz-utils tk-dev liblzma-dev netcat-traditional libyaml-dev
27+
28+
# Install ASDF
29+
RUN ASDF_VERSION=$(awk '!/^#/ && NF {print $1; exit}' /tmp/.tool-versions.asdf) && \
30+
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
31+
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"; \
32+
else \
33+
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"; \
34+
fi && \
35+
tar -xzf /tmp/asdf.tar.gz -C /tmp && \
36+
mkdir -p /usr/bin && \
37+
mv /tmp/asdf /usr/bin/asdf && \
38+
chmod +x /usr/bin/asdf && \
39+
rm -rf /tmp/asdf.tar.gz
2740

2841
# specify DOCKER_GID to force container docker group id to match host
2942
RUN if [ -n "${DOCKER_GID}" ]; then \
30-
if ! getent group docker; then \
31-
groupadd -g ${DOCKER_GID} docker; \
32-
else \
33-
groupmod -g ${DOCKER_GID} docker; \
34-
fi && \
35-
usermod -aG docker vscode; \
36-
fi
43+
if ! getent group docker; then \
44+
groupadd -g ${DOCKER_GID} docker; \
45+
else \
46+
groupmod -g ${DOCKER_GID} docker; \
47+
fi && \
48+
usermod -aG docker vscode; \
49+
fi
3750

3851
USER vscode
3952

4053
ENV PATH="/home/vscode/.asdf/shims/:$PATH"
4154
RUN \
42-
echo 'PATH="/home/vscode/.asdf/shims/:$PATH"' >> ~/.bashrc; \
43-
echo '. <(asdf completion bash)' >> ~/.bashrc;
55+
echo 'PATH="/home/vscode/.asdf/shims/:$PATH"' >> ~/.bashrc; \
56+
echo '. <(asdf completion bash)' >> ~/.bashrc;
4457

4558
ENV PATH="$PATH:/workspaces/electronic-prescription-service-api-regression-tests/node_modules/.bin"
4659

4760
# Install ASDF plugins for regression testing tools
4861
RUN asdf plugin add python && \
49-
asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git && \
50-
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git && \
51-
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git && \
52-
asdf plugin add actionlint && \
53-
asdf plugin add allure
62+
asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git && \
63+
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git && \
64+
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git && \
65+
asdf plugin add actionlint && \
66+
asdf plugin add allure
5467

5568
WORKDIR /workspaces/electronic-prescription-service-api-regression-tests
5669
ADD .tool-versions /workspaces/electronic-prescription-service-api-regression-tests/.tool-versions
5770
ADD .tool-versions /home/vscode/.tool-versions
5871

5972
# install python before poetry to ensure correct python version is used
6073
RUN asdf install python && \
61-
asdf install && \
62-
asdf reshim python && \
63-
asdf reshim poetry && \
64-
asdf reshim nodejs
74+
asdf install && \
75+
asdf reshim python && \
76+
asdf reshim poetry && \
77+
asdf reshim nodejs

.gitallowed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ body = f"username={urllib\.parse\.quote\(username\)}&password={urllib\.parse\.qu
2424
f"username={encoded_username}&password={encoded_password}&grant_type=password"
2525
self\.token = token
2626
id-token: write
27+
.*poetry\.lock.*brotli.*platform_python_implementation.*

0 commit comments

Comments
 (0)