FEAT: added user to build
This commit is contained in:
parent
1699bc8106
commit
07444ace8c
3 changed files with 10 additions and 3 deletions
11
Dockerfile
11
Dockerfile
|
@ -2,10 +2,15 @@
|
||||||
FROM golang:latest as builder
|
FROM golang:latest as builder
|
||||||
WORKDIR /go/src/github.com/PierreZ/goStatic
|
WORKDIR /go/src/github.com/PierreZ/goStatic
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -tags netgo -installsuffix netgo
|
RUN mkdir ./bin && \
|
||||||
|
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -tags netgo -installsuffix netgo -o ./bin/goStatic && \
|
||||||
|
mkdir ./bin/etc && \
|
||||||
|
cp ./passwd ./bin/etc && \
|
||||||
|
cp ./group ./bin/etc
|
||||||
|
|
||||||
# stage 1
|
# stage 1
|
||||||
FROM scratch
|
FROM scratch
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY --from=builder /go/src/github.com/PierreZ/goStatic/goStatic .
|
COPY --from=builder /go/src/github.com/PierreZ/goStatic/bin/ .
|
||||||
ENTRYPOINT ["/goStatic"]
|
USER appuser
|
||||||
|
ENTRYPOINT ["/goStatic"]
|
||||||
|
|
1
group
Normal file
1
group
Normal file
|
@ -0,0 +1 @@
|
||||||
|
appgroup:x:1231:appuser
|
1
passwd
Normal file
1
passwd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
appuser:x:1234:1231::/home/appuser:/bin/false
|
Loading…
Reference in a new issue