forked from plexsystems/sinker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (23 loc) · 926 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
ARG GOLANG_VERSION=1.15.0
ARG ALPINE_VERSION=3.12.0
FROM golang:${GOLANG_VERSION} AS builder
WORKDIR /build
COPY . /build
# Enable static builds
ENV CGO_ENABLED=0
RUN go get && \
go build
FROM alpine:${ALPINE_VERSION}
# OCI annotations (https://github.com/opencontainers/image-spec/blob/master/annotations.md)
LABEL org.opencontainers.image.source="https://github.com/plexsystems/sinker" \
org.opencontainers.image.title="sinker" \
org.opencontainers.image.authors="John Reese <[email protected]>" \
org.opencontainers.image.description="Application to sync images from one registry to another"
# explicitly set user/group IDs
# RUN set -eux \
# && addgroup -g 1001 -S sinker \
# && adduser -S -D -H -u 1001 -s /sbin/nologin -G sinker -g sinker sinker
RUN apk update && apk add --no-cache docker-cli
COPY --from=builder /build/sinker /usr/bin/
# USER sinker
ENTRYPOINT ["/usr/bin/sinker"]