tpotce/docker/dicompot/Dockerfile

34 lines
816 B
Text
Raw Normal View History

FROM golang:1.23-alpine AS builder
#
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux
#
# Include dist
COPY dist/ /root/dist/
2020-06-18 16:38:43 +00:00
#
2024-09-11 10:42:17 +00:00
# Install packages
RUN apk --no-cache -U add \
build-base \
git \
g++
2020-06-18 16:38:43 +00:00
#
# Setup go, build dicompot
RUN git clone https://github.com/nsmfoo/dicompot.git && \
2020-06-18 16:38:43 +00:00
cd dicompot && \
2020-10-27 21:30:33 +00:00
git checkout 41331194156bbb17078bcc1594f4952ac06a731e && \
cp /root/dist/go.mod .
WORKDIR /go/dicompot
RUN go mod tidy
RUN go mod download
RUN go build -o dicompot github.com/nsmfoo/dicompot/server
2020-06-18 16:38:43 +00:00
#
FROM scratch
#
COPY --from=builder /go/dicompot/dicompot /opt/dicompot/dicompot
COPY --from=builder /root/dist/dcm_pts/images /opt/dicompot/images
2020-06-18 16:38:43 +00:00
WORKDIR /opt/dicompot
USER 2000:2000
CMD ["-ip","0.0.0.0","-dir","images","-log","/var/log/dicompot/dicompot.log"]
ENTRYPOINT ["./dicompot"]