forked from cresta/atlantis-drift-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (19 loc) · 858 Bytes
/
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
FROM public.ecr.aws/docker/library/golang:1.19.5 as build
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' -o /atlantis-drift-detection ./cmd/atlantis-drift-detection/main.go
FROM public.ecr.aws/docker/library/ubuntu:23.04
RUN apt-get update \
&& apt-get install -y wget unzip git \
&& rm -rf /var/lib/apt/lists/*
ARG TERRAFORM_VERSION=1.2.3
# Download terraform for linux
RUN wget --quiet https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& mv terraform /usr/bin \
&& rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip
COPY --from=build /atlantis-drift-detection /atlantis-drift-detection
ENTRYPOINT ["/atlantis-drift-detection"]