-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (19 loc) · 908 Bytes
/
Dockerfile
File metadata and controls
33 lines (19 loc) · 908 Bytes
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
FROM ghcr.io/trueforge-org/golang:1.26.0@sha256:66c4ecd659c51f95aabf2632a65685b467d03747b3c2a690604b62ac9229641a AS builder
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /app
ARG VERSION
ENV WORKDIR=/app
RUN git clone --branch "${VERSION}" https://github.com/containrrr/watchtower.git
RUN cd watchtower && \
GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-extldflags '-static' -X github.com/containrrr/watchtower/internal/meta.Version=$(git describe --tags)" . && \
GO111MODULE=on go test ./... -v && \
chown -R apps:apps /app && chmod -R 755 /app
FROM ghcr.io/trueforge-org/ubuntu:24.04@sha256:c5a3b56e4d22600d2b618d602d487732516cc067cb21969798210c3b12304842
ENV WATCHTOWER_LABEL_ENABLE=true
USER apps
COPY --chmod=0755 . /
# copy files from other container
COPY --from=builder /app/watchtower/watchtower /app/watchtower
COPY --chmod=0775 . /
WORKDIR /app