11# ###########################
22# STEP 1 build executable binary
33# ###########################
4- FROM golang:1.23.5 as builder
4+ FROM golang:1.23.12 as builder
55
66WORKDIR /app
77
@@ -18,68 +18,42 @@ COPY . .
1818# Generate Code and Build
1919RUN make build
2020
21-
2221# ###########################
23- # STEP 2 build pushpin 22.04 image - source https://github.com/fanout/docker-pushpin/blob/master/Dockerfile
24- # TODO - this will rarely change - publish as an image we can consume
22+ # STEP 2: Grab CA certificates
2523# ###########################
26- # Pull the base image
27- FROM ubuntu:24.10 as pushpin
28-
29- # Add private APT repository
30- RUN \
31- apt-get update && \
32- apt-get install -y apt-transport-https software-properties-common && \
33- echo deb https://fanout.jfrog.io/artifactory/debian fanout-jammy main \
34- | tee /etc/apt/sources.list.d/fanout.list && \
35- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys \
36- 7D0343148157C3DF
37-
38- ENV PUSHPIN_VERSION 1.37.0-1~jammy
39-
40- # Install Pushpin
41- RUN \
42- apt-get update && \
43- apt-get install -y pushpin=$PUSHPIN_VERSION curl binutils
24+ FROM debian:bookworm-slim as certs
25+ RUN apt-get update && apt-get install -y ca-certificates
26+ RUN mkdir /tmp/certs && cp -r /etc/ssl/certs/* /tmp/certs
4427
45- # Required for the image to work on Centos7 with 3.10 kernel
46- RUN \
47- strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
28+ # ###########################
29+ # STEP 3: Add relay proxy to base pushpin image
30+ # ###########################
31+ FROM fanout/pushpin:1.41.0
4832
49- # Cleanup
50- RUN \
51- apt-get clean && \
52- rm -fr /var/lib/apt/lists/*
33+ # Use root user for setup
34+ USER root
5335
54- # Add entrypoint script
36+ # Copy entrypoint and binaries
5537COPY docker-entrypoint.sh /usr/local/bin/
56- # give permission to run entrypoint script
57- RUN chmod +x /usr/local/bin/docker-entrypoint.sh
58-
59- # Define default entrypoint and command
60- ENTRYPOINT ["docker-entrypoint.sh" ]
61- CMD ["pushpin" , "--merge-output" ]
62-
63-
64- # ###########################
65- # STEP 3 add relay proxy build to pushpin image
66- # ###########################
67- FROM pushpin
6838COPY --from=builder /app/ff-proxy /app/ff-proxy
69- COPY --from=builder ./app/config/pushpin /etc/pushpin
70- COPY --from=builder ./app/start.sh /start.sh
39+ COPY --from=builder /app/config/pushpin /etc/pushpin
40+ COPY --from=builder /app/start.sh /start.sh
41+
42+ # Copy CA certificates
43+ COPY --from=certs /tmp/certs /etc/ssl/certs
7144
72- RUN mkdir /log
73- RUN mkdir /pushpin
74- RUN mkdir / pushpin/run
75- RUN mkdir /pushpin/log
76- RUN chmod -R 0500 /app/ff-proxy / usr/lib/pushpin /etc/pushpin
77- RUN chmod -R 0755 /log /pushpin /usr/lib/pushpin /etc/pushpin
78- RUN chown -R 65534:65534 /app/ff-proxy /log /pushpin /usr/lib/pushpin /etc/pushpin
45+ # Prepare directories + set permissions in a single layer
46+ RUN chmod +x /usr/local/bin/docker-entrypoint.sh \
47+ && mkdir -p /log / pushpin/run /pushpin/log \
48+ && chmod 0500 /app/ff-proxy \
49+ && chmod -R 0755 / usr/lib/pushpin /etc/pushpin \
50+ && chmod -R 0775 /log /pushpin \
51+ && chown -R 65534:65534 /app/ff-proxy /log /pushpin /usr/lib/pushpin /etc/pushpin
7952
80- # Setting this to 65534 which hould be the nodbody user
81- USER 65534
53+ # Use nobody user for runtime
54+ USER 65534:65534
8255
8356# Expose default port pushpin listens on
8457EXPOSE 7000
58+ ENTRYPOINT ["docker-entrypoint.sh" ]
8559CMD ["./start.sh" ]
0 commit comments