-
Notifications
You must be signed in to change notification settings - Fork 114
/
Dockerfile
36 lines (29 loc) · 891 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM golang:alpine as builder
ARG LDFLAGS=""
RUN apk --update --no-cache add git build-base gcc
COPY . /build
WORKDIR /build
RUN go build -ldflags "${LDFLAGS}" -o goflow2 cmd/goflow2/main.go
FROM alpine:latest
ARG src_dir
ARG VERSION=""
ARG CREATED=""
ARG DESCRIPTION=""
ARG NAME=""
ARG MAINTAINER=""
ARG URL=""
ARG LICENSE=""
ARG REV=""
LABEL org.opencontainers.image.created="${CREATED}"
LABEL org.opencontainers.image.authors="${MAINTAINER}"
LABEL org.opencontainers.image.url="${URL}"
LABEL org.opencontainers.image.title="${NAME}"
LABEL org.opencontainers.image.version="${VERSION}"
LABEL org.opencontainers.image.description="${DESCRIPTION}"
LABEL org.opencontainers.image.licenses="${LICENSE}"
LABEL org.opencontainers.image.revision="${REV}"
RUN apk update --no-cache && \
adduser -S -D -H -h / flow
USER flow
COPY --from=builder /build/goflow2 /
ENTRYPOINT ["./goflow2"]