-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (36 loc) · 1.25 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
ARG REG=docker.io
FROM ${REG}/library/golang:1.18 AS build
WORKDIR /src
RUN go install github.com/swaggo/swag/cmd/[email protected]
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG BUILD_VERSION="local docker"
ARG BUILD_GIT_COMMIT="HEAD"
ARG BUILD_REF="0"
ARG BUILD_DATE=""
RUN chmod +x scripts/update-version.sh \
&& scripts/update-version.sh assets/version.yaml \
&& make swag check \
&& CGO_ENABLED=0 go build -o wharf ./cmd/wharf
ARG REG=docker.io
FROM ${REG}/library/alpine:3.15 AS final
RUN apk add --no-cache pcre2=10.40-r0 ca-certificates tzdata git
COPY --from=build /src/wharf /usr/local/bin/wharf
ENTRYPOINT ["/usr/local/bin/wharf"]
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-cmd" \
url="https://github.com/iver-wharf/wharf-cmd" \
release=${BUILD_REF} \
build-date=${BUILD_DATE} \
vendor="Iver" \
version=${BUILD_VERSION} \
vcs-type="git" \
vcs-url="https://github.com/iver-wharf/wharf-cmd" \
vcs-ref=${BUILD_GIT_COMMIT} \
changelog-url="https://github.com/iver-wharf/wharf-cmd/blob/${BUILD_VERSION}/CHANGELOG.md" \
authoritative-source-url="quay.io"