-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
85 lines (67 loc) · 2.21 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
############################
# STEP 1 build executable binary
############################
FROM golang:1.22 as builder
WORKDIR /app
ARG gitTag
ENV GIT_TAG $gitTag
# Fetch dependencies.
COPY go.mod .
COPY go.sum .
COPY Makefile .
RUN make dep
COPY . .
# Generate Code and Build
RUN make build
############################
# STEP 2 build pushpin 22.04 image - source https://github.com/fanout/docker-pushpin/blob/master/Dockerfile
# TODO - this will rarely change - publish as an image we can consume
############################
# Pull the base image
FROM ubuntu:24.10 as pushpin
# Add private APT repository
RUN \
apt-get update && \
apt-get install -y apt-transport-https software-properties-common && \
echo deb https://fanout.jfrog.io/artifactory/debian fanout-jammy main \
| tee /etc/apt/sources.list.d/fanout.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys \
7D0343148157C3DF
ENV PUSHPIN_VERSION 1.37.0-1~jammy
# Install Pushpin
RUN \
apt-get update && \
apt-get install -y pushpin=$PUSHPIN_VERSION curl binutils
# Required for the image to work on Centos7 with 3.10 kernel
RUN \
strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
# Cleanup
RUN \
apt-get clean && \
rm -fr /var/lib/apt/lists/*
# Add entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
# give permission to run entrypoint script
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Define default entrypoint and command
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["pushpin", "--merge-output"]
############################
# STEP 3 add relay proxy build to pushpin image
############################
FROM pushpin
COPY --from=builder /app/ff-proxy /app/ff-proxy
COPY --from=builder ./app/config/pushpin /etc/pushpin
COPY --from=builder ./app/start.sh /start.sh
RUN mkdir /log
RUN mkdir /pushpin
RUN mkdir /pushpin/run
RUN mkdir /pushpin/log
RUN chmod -R 0500 /app/ff-proxy /usr/lib/pushpin /etc/pushpin
RUN chmod -R 0755 /log /pushpin /usr/lib/pushpin /etc/pushpin
RUN chown -R 65534:65534 /app/ff-proxy /log /pushpin /usr/lib/pushpin /etc/pushpin
# Setting this to 65534 which hould be the nodbody user
USER 65534
# Expose default port pushpin listens on
EXPOSE 7000
CMD ["./start.sh"]