try to build nginx from alpine

This commit is contained in:
hugo gogo
2022-09-06 12:45:50 +02:00
parent c2ecbf5e11
commit 409599d558
4 changed files with 45 additions and 27 deletions

View File

@@ -1,11 +1,20 @@
#FROM alpine:3.15
FROM debian:buster
# alpine :
FROM alpine:3.15
# debian :
#FROM debian:buster
RUN apt update && apt install -y nginx openssl
# alpine :
RUN apk add nginx openssl
# debian :
#RUN apt update && apt install -y nginx openssl && rm -rf /var/lib/apt/lists/*
# for debug
#RUN apt install -y procps vim
# alpine :
RUN mkdir -p /etc/ssl/private
RUN mkdir -p /etc/ssl/certs
# create ssl certificate
RUN openssl req -newkey rsa:2048 -nodes -x509 \
-keyout /etc/ssl/private/hulamy.42.fr.key -out /etc/ssl/certs/hulamy.42.fr.crt \
@@ -22,6 +31,9 @@ COPY ./conf/https/index.html /data/wwws/
CMD [ "nginx", "-g", "daemon off;" ]
#
# run nginx with alpine :
# https://www.techtarget.com/searchitoperations/tutorial/Use-Docker-and-Alpine-Linux-to-build-lightweight-containers
#
# -g 'daemon off' :
# daemon off, to avoid the main process of nginx to quit after creating its childs, and therefore make docker exit