initial commit
This commit is contained in:
commit
0e6be50e37
23 changed files with 1069 additions and 0 deletions
15
testapp/api/Dockerfile
Normal file
15
testapp/api/Dockerfile
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
FROM golang:alpine
|
||||
ARG VERSION
|
||||
RUN mkdir /build
|
||||
ADD . /build/
|
||||
WORKDIR /build
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -gcflags '-e' -ldflags "-X main.version=$VERSION -s -w" -o main .
|
||||
RUN echo -e "root:x:0:0:root:/:\nappuser:x:1000:1000:appuser:/:" > /etc/passwd
|
||||
RUN echo -e "root:x:0:root\nappuser:x:1000:" > /etc/group
|
||||
FROM scratch
|
||||
COPY --from=0 /build/main /
|
||||
COPY --from=0 /etc/passwd /etc/
|
||||
COPY --from=0 /etc/group /etc/
|
||||
USER appuser
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/main"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue