mirror of
https://github.com/wneessen/apg-go.git
synced 2024-11-22 13:50:49 +01:00
19 lines
No EOL
658 B
Docker
19 lines
No EOL
658 B
Docker
## Build first
|
|
FROM golang:latest as builder
|
|
RUN mkdir /builddir
|
|
ADD . /builddir/
|
|
WORKDIR /builddir
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags '-w -s -extldflags "-static"' -o apg-go \
|
|
github.com/wneessen/apg-go/cmd/apg
|
|
|
|
## Create scratch image
|
|
FROM scratch
|
|
LABEL maintainer="wn@neessen.net"
|
|
COPY ["docker-files/passwd", "/etc/passwd"]
|
|
COPY ["docker-files/group", "/etc/group"]
|
|
COPY --chown=apg-go ["LICENSE", "/apg-go/LICENSE"]
|
|
COPY --chown=apg-go ["README.md", "/apg-go/README.md"]
|
|
COPY --from=builder --chown=apg-go ["/builddir/apg-go", "/apg-go/apg-go"]
|
|
WORKDIR /apg-go
|
|
USER apg-go
|
|
ENTRYPOINT ["/apg-go/apg-go"] |