Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# these don't end up in the final image, but no need to consider them in the build context
*.md
LICENSE
images
ui
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:latest
FROM golang:latest AS builder

LABEL app="slo-tracker"
LABEL maintainer="roshan.aloor@gmail.com"
Expand All @@ -8,9 +8,16 @@ LABEL description="slo-tracker : Track your product SLO"
WORKDIR /app

COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/slo-tracker .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o /app/slo-tracker .


FROM scratch

# we don't need these certs for local development, but we copy in case you want
# to use this image for a production environment
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /app/slo-tracker /app/slo-tracker

EXPOSE 8080

CMD /app/slo-tracker
CMD ["/app/slo-tracker"]