s3manager-web/Dockerfile

14 lines
452 B
Docker
Raw Normal View History

2018-10-27 14:59:59 +02:00
FROM golang:1 as builder
2018-11-30 23:09:00 +01:00
RUN groupadd -r s3manager && useradd --no-log-init -r -g s3manager s3manager
WORKDIR /usr/src/s3manager
2018-10-27 14:59:59 +02:00
COPY . ./
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -a -installsuffix cgo -o bin/s3manager ./cmd/s3manager
FROM scratch
2018-11-30 23:09:00 +01:00
WORKDIR /usr/s3manager
COPY --from=builder /usr/src/s3manager/bin/s3manager /usr/src/s3manager/web ./
COPY --from=builder /etc/passwd /etc/passwd
USER s3manager
2018-10-27 14:59:59 +02:00
EXPOSE 8080
ENTRYPOINT ["./s3manager"]