From 0f16077066dd79b51922f188f7de80bee972d1e7 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Sun, 26 Sep 2021 10:45:43 -0700 Subject: [PATCH] use a separate Dockerfile for publishing to Dockerhub --- Dockerfile | 11 +---------- Dockerfile.build | 12 ++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 Dockerfile.build diff --git a/Dockerfile b/Dockerfile index 7341cd6..f88a6e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,3 @@ -FROM golang:latest -WORKDIR /app -COPY go.mod go.sum ./ -RUN go mod download -COPY main.go . -RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o github-action-to-otlp . +FROM codeboten/github-action-to-otlp:v1 -FROM alpine:latest -RUN apk --no-cache add ca-certificates -WORKDIR /root/ -COPY --from=0 /app/github-action-to-otlp . ENTRYPOINT ["/root/github-action-to-otlp"] diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000..7341cd6 --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,12 @@ +FROM golang:latest +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY main.go . +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o github-action-to-otlp . + +FROM alpine:latest +RUN apk --no-cache add ca-certificates +WORKDIR /root/ +COPY --from=0 /app/github-action-to-otlp . +ENTRYPOINT ["/root/github-action-to-otlp"]