-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.bordercontrol
49 lines (38 loc) · 1.35 KB
/
Dockerfile.bordercontrol
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
45
46
47
48
49
FROM golang:1.22.3-bookworm AS builder
COPY / /src/bordercontrol
WORKDIR /src/bordercontrol/bordercontrol
RUN go mod tidy && \
go build ./... && \
go install ./...
FROM debian:bookworm-20240513-slim
ARG S6_OVERLAY_VERSION=3.1.6.0
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x && \
# Install required packages
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
KEPT_PACKAGES+=(net-tools) && \
KEPT_PACKAGES+=(procps) && \
KEPT_PACKAGES+=(xz-utils) && \
apt-get clean && \
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*
COPY --from=builder /go/bin/bordercontrol /usr/local/bin/bordercontrol
COPY bordercontrol/rootfs/ /
# Deploy s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
# Configure s6 overlay
ENV S6_LOGGING=0 \
S6_VERBOSITY=1
# Set s6 init as entrypoint
ENTRYPOINT [ "/init" ]