-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (26 loc) · 1.1 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
# --- Build stage ---
FROM docker.io/golang:1.22 AS build
ARG TARGETOS
ARG TARGETARCH
ARG VERSION=1.7.1
ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}
ENV GO111MODULE=on
ENV CGO_ENABLED=0
WORKDIR /build
RUN git clone --single-branch --branch v${VERSION} https://github.com/containrrr/watchtower.git /build
RUN set -ex ; \
go build -a -ldflags "-extldflags '-static' -X github.com/containrrr/watchtower/internal/meta.Version=$(git describe --tags)" -o /build/bin/watchtower ; \
go test ./... -v
# --- Final stage ---
FROM cgr.dev/chainguard/wolfi-base:latest
COPY --from=build --chmod=755 /build/bin/watchtower /usr/bin/watchtower
EXPOSE 8080/tcp
HEALTHCHECK CMD [ "/usr/bin/watchtower", "--health-check"]
ENTRYPOINT [ "/usr/bin/watchtower" ]
LABEL \
org.opencontainers.image.title="watchtower" \
org.opencontainers.image.source="https://github.com/f-bn/containers-images/watchtower" \
org.opencontainers.image.description="A process for automating Docker container base image updates" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.authors="Florian Bobin <[email protected]>"