Skip to content

Commit

Permalink
use a separate Dockerfile for publishing to Dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
codeboten committed Sep 26, 2021
1 parent f3a6f67 commit 0f16077
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 1 addition & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 12 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 0f16077

Please sign in to comment.