-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (38 loc) · 1.35 KB
/
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
37
38
39
40
41
ARG REG=docker.io
FROM ${REG}/library/golang:1.18 AS build
WORKDIR /src
ENV GO111MODULE=on
RUN go install github.com/swaggo/swag/cmd/[email protected]
COPY go.mod go.sum ./
RUN go mod download
COPY . /src
ARG BUILD_VERSION="local docker"
ARG BUILD_GIT_COMMIT="HEAD"
ARG BUILD_REF="0"
ARG BUILD_DATE=""
RUN chmod +x deploy/update-version.sh \
&& deploy/update-version.sh version.yaml \
&& make swag check \
&& CGO_ENABLED=0 go build -o wharf-provider-gitlab .
ARG REG=docker.io
FROM ${REG}/library/alpine:3.15 AS final
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=build /src/wharf-provider-gitlab /usr/local/bin/wharf-provider-gitlab
ENTRYPOINT ["/usr/local/bin/wharf-provider-gitlab"]
ARG BUILD_VERSION
ARG BUILD_GIT_COMMIT
ARG BUILD_REF
ARG BUILD_DATE
# The added labels are based on this: https://github.com/projectatomic/ContainerApplicationGenericLabels
LABEL name="iver-wharf/wharf-provider-gitlab" \
url="https://github.com/iver-wharf/wharf-provider-gitlab" \
release=${BUILD_REF} \
build-date=${BUILD_DATE} \
vendor="Iver" \
version=${BUILD_VERSION} \
vcs-type="git" \
vcs-url="https://github.com/iver-wharf/wharf-provider-gitlab" \
vcs-ref=${BUILD_GIT_COMMIT} \
changelog-url="https://github.com/iver-wharf/wharf-provider-gitlab/blob/${BUILD_VERSION}/CHANGELOG.md" \
authoritative-source-url="quay.io"