Update and rename Dockerfile to Containerfile

This commit is contained in:
Rawley Fowler
2022-05-10 14:02:58 -06:00
committed by GitHub
parent 5afbd3e15b
commit 3a3906ebc7

View File

@@ -1,16 +1,11 @@
# syntax = docker/dockerfile:1
FROM --platform=${BUILDPLATFORM} golang:1.18-bullseye AS build FROM --platform=${BUILDPLATFORM} golang:1.18-bullseye AS build
WORKDIR . WORKDIR .
ENV CGO_ENABLED=0 ENV CGO_ENABLED=0
COPY . .
ARG TARGETOS ARG TARGETOS
ARG TARGETARCH ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /bin/rawleydotxyz . RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /bin/rawleydotxyz .
FROM scratch AS bin FROM scratch AS bin
COPY --from=build /bin/rawleydotxyz / COPY --from=build /bin/rawleydotxyz /
FROM golang:1.18-bullseye AS run
EXPOSE 8080/tcp EXPOSE 8080/tcp
CMD ["/rawleydotxyz"] CMD ["/rawleydotxyz"]