-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile.synchronizer
More file actions
38 lines (26 loc) · 1.04 KB
/
Dockerfile.synchronizer
File metadata and controls
38 lines (26 loc) · 1.04 KB
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
# Build stage
FROM golang:1.26.1-bookworm AS builder
ARG EXTRA_BUILD_ARGS
ARG FIPS_MODE
RUN apt update && \
apt install -y --no-install-recommends build-essential ca-certificates python3 git && \
rm -rf /var/lib/apt/lists/*
WORKDIR /code
COPY . .
RUN bash -c 'if [[ "${FIPS_MODE}" = "enabled" ]]; \
then echo "building in fips mode"; make clean split-sync-fips entrypoints EXTRA_BUILD_ARGS="${EXTRA_BUILD_ARGS}"; mv split-sync-fips split-sync; \
else echo "building in standard mode"; make clean split-sync entrypoints EXTRA_BUILD_ARGS="${EXTRA_BUILD_ARGS}"; \
fi'
# Runner stage
FROM debian:13.3 AS runner
RUN apt update -y
RUN apt upgrade -y
RUN apt install -y bash ca-certificates
RUN groupadd -g 1000 split-synchronizer
RUN useradd -r -u 1000 -g split-synchronizer -s /usr/sbin/nologin split-synchronizer
COPY docker/functions.sh .
COPY --from=builder /code/split-sync /usr/bin/
COPY --from=builder /code/entrypoint.synchronizer.sh .
EXPOSE 3000 3010
USER 'split-synchronizer'
ENTRYPOINT ["bash", "entrypoint.synchronizer.sh"]