diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9414382 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ef78533 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM golang:alpine + +RUN apk add --no-cache git upx + +WORKDIR /fargate + +ADD go.mod . +RUN go mod download + +ADD . /fargate +RUN go build -ldflags="-s -w" +RUN upx --brute fargate + +FROM alpine + +RUN apk add --no-cache ca-certificates + +COPY --from=0 /fargate/fargate /usr/local/bin/