Skip to content

Commit

Permalink
update exitcodes Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Sep 1, 2024
1 parent a86d685 commit 9799bb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions docker/exitcodes/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Start from the latest golang base image
FROM golang:latest
FROM golang:latest as go-builder
MAINTAINER Valentin Kuznetsov [email protected]
ENV WDIR=/data
WORKDIR $WDIR
RUN go get github.com/sirupsen/logrus
RUN go get -d github.com/shirou/gopsutil/...
RUN go get github.com/vkuznet/CMSExitCodes
#RUN go mod init github.com/vkuznet/CMSExitCodes
#RUN go list -m all
#RUN go get -d -v github.com/vkuznet/CMSExitCodes
RUN sed -i -e "s,ROOT,/go/src/github.com/vkuznet/CMSExitCodes,g" /go/src/github.com/vkuznet/CMSExitCodes/server.json
CMD ["CMSExitCodes", "-config", "/go/src/github.com/vkuznet/CMSExitCodes/server.json"]
ARG CGO_ENABLED=0
ENV TAG=v0.1.0
RUN git clone https://github.com/vkuznet/CMSExitCodes.git
WORKDIR $WDIR/CMSExitCodes
RUN git checkout tags/$TAG -b build && make
RUN sed -i -e "s,ROOT,/data/CMSExitCodes,g" /data/CMSExitCodes/server.json

# https://blog.baeke.info/2021/03/28/distroless-or-scratch-for-go-apps/
FROM alpine
# FROM gcr.io/distroless/static AS final
COPY --from=go-builder /data/CMSExitCodes /data/CMSExitCodes
CMD ["/data/CMSExitCodes/CMSExitCodes", "-config", "/data/CMSExitCodes/server.json"]
2 changes: 1 addition & 1 deletion docker/exitcodes/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"jscripts": "js",
"styles": "css",
"images": "images",
"verbose": 0
"verbose": 1
}

0 comments on commit 9799bb9

Please sign in to comment.