-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
80 lines (67 loc) · 3.45 KB
/
Dockerfile
File metadata and controls
80 lines (67 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM mcr.microsoft.com/devcontainers/base:ubuntu
ARG TARGETARCH
ENV TARGETARCH=${TARGETARCH}
ARG ASDF_VERSION
COPY .tool-versions.asdf /tmp/.tool-versions.asdf
# Add amd64 architecture if on arm64
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then dpkg --add-architecture amd64; fi
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y dist-upgrade \
&& apt-get -y install --no-install-recommends htop vim curl git build-essential \
libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev libbz2-dev \
zlib1g-dev unixodbc unixodbc-dev libsecret-1-0 libsecret-1-dev libsqlite3-dev \
jq apt-transport-https ca-certificates gnupg-agent \
software-properties-common bash-completion python3-pip make libbz2-dev \
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev liblzma-dev netcat-traditional ruby-full build-essential zlib1g-dev \
&& apt remove -y openjdk-8-jdk-headless openjdk-8-jre-headless openjdk-8-jre
# Download correct AWS CLI for arch
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
else \
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"; \
fi && \
unzip /tmp/awscliv2.zip -d /tmp/aws-cli && \
/tmp/aws-cli/aws/install && \
rm /tmp/awscliv2.zip && rm -rf /tmp/aws-cli
# Download correct SAM CLI for arch
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
wget -O /tmp/aws-sam-cli.zip "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-arm64.zip"; \
else \
wget -O /tmp/aws-sam-cli.zip "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip"; \
fi && \
unzip /tmp/aws-sam-cli.zip -d /tmp/aws-sam-cli && \
/tmp/aws-sam-cli/install && \
rm /tmp/aws-sam-cli.zip && rm -rf /tmp/aws-sam-cli
# Install ASDF
RUN ASDF_VERSION=$(awk '!/^#/ && NF {print $1; exit}' /tmp/.tool-versions.asdf) && \
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
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; \
else \
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; \
fi && \
tar -xvzf /tmp/asdf.tar.gz && \
mv asdf /usr/bin
USER vscode
ENV PATH="/home/vscode/.asdf/shims/:$PATH"
RUN \
echo 'PATH="/home/vscode/.asdf/shims/:$PATH"' >> ~/.bashrc; \
echo '. <(asdf completion bash)' >> ~/.bashrc; \
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc; \
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc; \
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc;
# Install ASDF plugins
RUN asdf plugin add python && \
asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git && \
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git && \
asdf plugin add java && \
asdf plugin add maven && \
asdf plugin add direnv && \
asdf plugin add actionlint && \
asdf plugin add nodejs;
WORKDIR /workspaces/validation-service-fhir-r4
ADD .tool-versions /workspaces/validation-service-fhir-r4/.tool-versions
ADD .tool-versions /home/vscode/.tool-versions
RUN asdf install python && \
asdf install