2022-06-10 09:12:21 +00:00
|
|
|
FROM golang:1.18 AS builder
|
2020-12-11 16:12:22 +00:00
|
|
|
|
|
|
|
ARG OS="linux"
|
|
|
|
ARG ARCH="amd64"
|
|
|
|
|
|
|
|
WORKDIR /go/src/app
|
|
|
|
COPY go.mod go.sum Makefile ./
|
2021-07-27 14:47:17 +00:00
|
|
|
RUN go mod download
|
2020-12-11 16:12:22 +00:00
|
|
|
COPY . .
|
2021-07-27 14:47:17 +00:00
|
|
|
RUN SINGLE_TARGET=true make release
|
2020-12-11 16:12:22 +00:00
|
|
|
|
2022-07-06 20:06:50 +00:00
|
|
|
FROM alpine:3.16
|
2020-12-11 16:12:22 +00:00
|
|
|
|
|
|
|
ARG OS="linux"
|
|
|
|
ARG ARCH="amd64"
|
|
|
|
|
|
|
|
WORKDIR /app
|
2021-07-27 14:16:04 +00:00
|
|
|
COPY --from=builder /go/src/app/bin/driftctl_${OS}_${ARCH}/driftctl /bin/driftctl
|
|
|
|
RUN chmod +x /bin/driftctl
|
2020-12-11 16:12:22 +00:00
|
|
|
ENTRYPOINT ["/bin/driftctl"]
|