Skip to content

Commit

Permalink
feat(image): reduce image size (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: raojinlin <raojinlin302@gmail.com>
  • Loading branch information
raojinlin and raojinlin authored Dec 29, 2023
1 parent e5f5878 commit fe37123
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
FROM golang:1.19.3
FROM golang:1.19.3 as builder

COPY . /code
WORKDIR /code
RUN go mod tidy && go build -o cri-logs-term-serve .

RUN go mod tidy && CGO_ENABLED=0 go build -o ./clogs .


FROM alpine

COPY ./template /code/template
COPY --from=builder /code/clogs /usr/bin/clogs

WORKDIR /code
ENV GIN_MODE=release
CMD ["./cri-logs-term-serve"]

CMD ["/usr/bin/clogs"]


0 comments on commit fe37123

Please sign in to comment.