-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
33 lines (27 loc) · 1.45 KB
/
Dockerfile
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
# Set this to the version of Atlantis you want to use
ARG version=latest
FROM ghcr.io/runatlantis/atlantis:${version}
# Set to root user so we can install packages
USER root
# Set this to the minor version of Infracost CLI you want to use (e.g., v0.9, v0.10)
ARG cli_version=v0.10
# Install required packages and latest ${cli_version} version of Infracost
RUN apk --update --no-cache add ca-certificates openssl openssh-client curl git jq
# Download and install the correct Infracost binary based on the target architecture
ARG TARGETARCH
RUN \
curl -s -L "https://infracost.io/downloads/$cli_version/infracost-linux-${TARGETARCH}.tar.gz" | tar xz -C /tmp && \
mv /tmp/infracost-linux-${TARGETARCH} /usr/bin/infracost
### Legacy logic - not needed for new users
# The following logic is to support older infracost-atlantis users that used the atlantis_diff.sh script and compost.
# We do not plan to add new features to the old integration below so we recommend everyone to upgrade to the new
# usage methods mentioned in the README.
RUN apk --update --no-cache add nodejs npm
RUN \
curl -s -L -o /home/atlantis/infracost_atlantis_diff.sh https://raw.githubusercontent.com/infracost/infracost/master/scripts/ci/atlantis_diff.sh && \
chmod +x /home/atlantis/infracost_atlantis_diff.sh && \
ln -s /home/atlantis/infracost_atlantis_diff.sh /infracost_atlantis_diff.sh && \
npm install -g @infracost/compost
### End of legacy logic
# Restore the atlantis user
USER atlantis