-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.multiarch
37 lines (30 loc) · 1.44 KB
/
Dockerfile.multiarch
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
#https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
#ARG QEMU_ARCH=x86_64
#ARG TARGET_ARCH=amd64
#FROM multiarch/qemu-user-static:x86_64-$QEMU_ARCH AS qemu
#FROM $TARGET_ARCH/nginx:alpine
#ARG QEMU_ARCH=x86_64
#Copy architecture emulation static binary
#COPY --from=qemu /usr/bin/qemu-$QEMU_ARCH-static /usr/bin
ARG TARGET_ARCH=amd64
FROM $TARGET_ARCH/nginx:alpine
ARG QEMU_ARCH=x86_64
# Copy downloaded architecture emulation static binary
COPY qemu-$QEMU_ARCH-static /usr/bin/
######### Dockerfile BODY
RUN apk add --update --no-cache certbot certbot-nginx
ADD scripts /scripts
ADD templates/certbot.sh /scripts
ADD templates/simplelogin.conf /etc/nginx/conf.d
ADD files/index.html /usr/share/nginx/html
ADD files/certs/ssl-cert-snakeoil.key /etc/ssl/private/ssl-cert-snakeoil.key
ADD files/certs/ssl-cert-snakeoil.pem /etc/ssl/ssl-cert-snakeoil.pem
RUN rm -f /etc/nginx/conf.d/default.conf && \
chmod a+x /scripts/* && \
touch /var/run/nginx.pid && \
mkdir /var/log/letsencrypt /var/lib/letsencrypt && \
chown -R nginx:nginx /var/log/letsencrypt /var/lib/letsencrypt /var/run/nginx.pid /scripts /etc/nginx /var/cache/nginx
USER nginx
#Remove "user" directive to disable warning as nginx user: "user" directive makes sense only if the master process runs with super-user privileges
RUN sed -i "s/^\s*user\s\s*nginx;/#user nginx;/g" /etc/nginx/nginx.conf
CMD /scripts/startup.sh