initial commit
This commit is contained in:
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
# Build Container
|
||||
####
|
||||
FROM golang:alpine AS builder
|
||||
|
||||
COPY . /go/src/app
|
||||
|
||||
WORKDIR /go/src/app
|
||||
|
||||
RUN apk add --no-cache git && \
|
||||
git config --global --add safe.directory /go/src/app && \
|
||||
addgroup -S -g 1000 app && \
|
||||
adduser --disabled-password -G app --gecos "application account" --home "/home/app" --shell "/sbin/nologin" --no-create-home --uid 1000 app && \
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags timetzdata -o go-webserver ./
|
||||
|
||||
# Step 3 - Running Container
|
||||
####
|
||||
FROM scratch
|
||||
|
||||
COPY --from=builder /etc/passwd /etc/group /etc/
|
||||
COPY --from=builder --chown=app:app /go/src/app/go-webserver /app/go-webserver
|
||||
|
||||
USER app:app
|
||||
WORKDIR /app/
|
||||
|
||||
ENTRYPOINT ["/app/go-webserver"]
|
Reference in New Issue
Block a user