-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (43 loc) · 1.9 KB
/
Dockerfile
File metadata and controls
55 lines (43 loc) · 1.9 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
FROM ubuntu:24.04
ARG TARGETARCH
ENV TARGETARCH=${TARGETARCH}
ARG ASDF_VERSION
COPY .tool-versions.asdf /tmp/.tool-versions.asdf
ARG VERSION
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y upgrade \
&& apt-get -y install --no-install-recommends ca-certificates curl git jq make unzip wget \
&& apt-get clean
# install aws stuff
# 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
# 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
RUN useradd -ms /bin/bash cdkuser
RUN chown -R cdkuser /home/cdkuser
WORKDIR /home/cdkuser
USER cdkuser
ENV PATH="$PATH:/home/cdkuser/.asdf/shims/:/home/cdkuser/node_modules/.bin"
# Install ASDF plugins
RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
# install some common node versions that are used in builds to speed things up
RUN asdf install nodejs 22.20.0;
# copy files needed for deployment
COPY --chown=cdkuser docker/entrypoint.sh /home/cdkuser/
RUN echo "${VERSION}" > version.txt
ENTRYPOINT ["/home/cdkuser/entrypoint.sh"]