Skip to content

Commit

Permalink
Merge pull request #61 from borosr/main
Browse files Browse the repository at this point in the history
Optimize docker image size
  • Loading branch information
PeterOsinski authored Nov 1, 2024
2 parents 2e01acd + 00b99f0 commit 1f78f8c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM golang:1
FROM golang:1-alpine AS builder

# For available labels, see OCI Annotations Spec docs:
# https://specs.opencontainers.org/image-spec/annotations/#pre-defined-annotation-keys
Expand All @@ -12,9 +12,13 @@ COPY ./ /go/src/logdy-core/
RUN \
--mount=type=cache,mode=0755,target=/root/.cache/go-build/ \
--mount=type=cache,mode=0755,target=/go/pkg/mod/cache/ \
go build -x -v \
go build -x -v -o /go/bin/logdy-core \
&& go install -x -v \
&& go clean -v

ENTRYPOINT [ "/go/bin/logdy-core", "--ui-ip", "0.0.0.0" ]
FROM alpine:latest

COPY --from=builder /go/bin/logdy-core /logdy

ENTRYPOINT ["/logdy", "--ui-ip", "0.0.0.0" ]
CMD [ "stdin" ]

0 comments on commit 1f78f8c

Please sign in to comment.