Skip to content

Commit

Permalink
Merge pull request #21 from mozilla-services/dockerize-metrics-cli-app
Browse files Browse the repository at this point in the history
Dockerize metrics CLI app 🐳
  • Loading branch information
hackebrot authored Jun 13, 2024
2 parents 69f56c7 + f0ac9f7 commit a931f92
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions metrics/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Exclude everything by default
*

# Except for Go source files and Go dependency files
!**/*.go
!go.mod
!go.sum
17 changes: 17 additions & 0 deletions metrics/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.22 AS builder

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -o /app/metrics

FROM gcr.io/distroless/static-debian12:nonroot

COPY --from=builder /app/metrics /app/metrics

ENTRYPOINT [ "/app/metrics" ]

0 comments on commit a931f92

Please sign in to comment.