From 5afbd3e15b4887793acd2002f06842929a84d093 Mon Sep 17 00:00:00 2001 From: Rawley Fowler <75388349+rawleyfowler@users.noreply.github.com> Date: Tue, 10 May 2022 13:24:44 -0600 Subject: [PATCH] Create Dockerfile --- Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..679268e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# syntax = docker/dockerfile:1 + +FROM --platform=${BUILDPLATFORM} golang:1.18-bullseye AS build +WORKDIR . +ENV CGO_ENABLED=0 +COPY . . +ARG TARGETOS +ARG TARGETARCH +RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /bin/rawleydotxyz . + +FROM scratch AS bin +COPY --from=build /bin/rawleydotxyz / + +FROM golang:1.18-bullseye AS run +EXPOSE 8080/tcp +CMD ["/rawleydotxyz"]