Skip to content

Commit

Permalink
Merge pull request #448 from flanksource/improve-dockerfile
Browse files Browse the repository at this point in the history
feat: remove apt install from dockerfile
  • Loading branch information
moshloop authored Jul 20, 2023
2 parents 4fbb049 + b3fc15b commit 3698bed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Dockerfile
.bin/
.vscode/
.idea/
.env
.DS_Store
cover.out
test.test
build/
12 changes: 1 addition & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,13 @@ COPY go.mod /app/go.mod
COPY go.sum /app/go.sum
RUN go mod download
COPY ./ ./

WORKDIR /app
RUN go version
RUN make build

FROM ubuntu:jammy
WORKDIR /app

# install CA certificates
RUN apt-get update && \
apt-get install -y ca-certificates && \
rm -Rf /var/lib/apt/lists/* && \
rm -Rf /usr/share/doc && rm -Rf /usr/share/man && \
apt-get clean

COPY --from=builder /app/.bin/incident-commander /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

RUN /app/incident-commander go-offline

ENTRYPOINT ["/app/incident-commander"]
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ var Serve = &cobra.Command{
listenAddr := fmt.Sprintf(":%d", httpPort)
logger.Infof("Listening on %s", listenAddr)
if err := e.Start(listenAddr); err != nil {
e.Logger.Fatal(err)
logger.Fatalf("Failed to start server: %v", err)
}
},
}
Expand Down

0 comments on commit 3698bed

Please sign in to comment.