-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
44 lines (34 loc) · 1.12 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
42
43
44
FROM golang:1.22.5 AS builder
COPY . /go/src/github.com/NectGmbH/db-backup-controller
WORKDIR /go/src/github.com/NectGmbH/db-backup-controller
RUN set -ex \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
git \
&& mkdir /build \
&& cd /go/src/github.com/NectGmbH/db-backup-controller/cmd/backup-controller \
&& go build \
-ldflags "-s -w -X main.version=$(git describe --tags --always || echo dev)" \
-mod=readonly \
-modcacherw \
-trimpath \
-o /build/backup-controller \
&& cd /go/src/github.com/NectGmbH/db-backup-controller/cmd/backup-runner \
&& go build \
-ldflags "-s -w -X main.version=$(git describe --tags --always || echo dev)" \
-mod=readonly \
-modcacherw \
-trimpath \
-o /build/backup-runner
FROM debian:12-slim
LABEL maintainer "Knut Ahlers <[email protected]>"
RUN set -ex \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates \
&& rm -rf /var/lib/apt/*
COPY --from=builder /build/* /usr/local/bin/
EXPOSE 3000
ENTRYPOINT ["/usr/local/bin/backup-controller"]
CMD ["--"]
# vim: set ft=Dockerfile: