Adds Dockerfile
This commit is contained in:
parent
ef68e8c4a2
commit
21b9343534
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Step 1 - 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 && \
|
||||||
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v -ldflags="-s -w" -tags timetzdata -o ifire ./
|
||||||
|
|
||||||
|
# Step 2 - Running Container
|
||||||
|
####
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.title="Is the internet on fire?"
|
||||||
|
|
||||||
|
RUN addgroup -S -g 1000 app && \
|
||||||
|
adduser --disabled-password -G app --gecos "application account" --home "/home/app" --shell "/sbin/nologin" --uid 1000 app && \
|
||||||
|
apk add --no-cache bind-tools
|
||||||
|
COPY --from=builder --chown=app:app /go/src/app/ifire /usr/local/bin/ifire
|
||||||
|
|
||||||
|
USER app:app
|
||||||
|
WORKDIR /home/app
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/sh", "-c", "ifire"]
|
Loading…
x
Reference in New Issue
Block a user