-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
23 lines (17 loc) · 960 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
FROM golang:1.20.6-alpine3.18 as builder
RUN apk add --no-cache --no-progress git make
COPY . /src
ARG BININFO_BUILD_DATE BININFO_COMMIT_HASH BININFO_VERSION # provided to 'make install'
RUN make -C /src install PREFIX=/pkg GO_BUILDFLAGS='-mod vendor'
################################################################################
FROM alpine:3.18
# upgrade all installed packages to fix potential CVEs in advance
RUN apk upgrade --no-cache --no-progress \
&& apk add --no-cache --no-progress ca-certificates
COPY --from=builder /pkg/bin/ /opt/resource/
ARG BININFO_BUILD_DATE BININFO_COMMIT_HASH BININFO_VERSION
LABEL source_repository="https://github.com/sapcc/concourse-swift-resource" \
org.opencontainers.image.url="https://github.com/sapcc/concourse-swift-resource" \
org.opencontainers.image.created=${BININFO_BUILD_DATE} \
org.opencontainers.image.revision=${BININFO_COMMIT_HASH} \
org.opencontainers.image.version=${BININFO_VERSION}