forked from krestomatio/container_builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (51 loc) · 1.98 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
# Ansible managed
FROM quay.io/krestomatio/base-stream
# General variables
ENV IMAGE_NAME=nginx \
IMAGE_SUMMARY="Nginx 1.18" \
IMAGE_DESCRIPTION="This CentOS 8 Stream minimal based container image runs Nginx 1.18" \
IMAGE_TITLE="Nginx 1.18" \
IMAGE_SERVICE_PORT="8080" \
IMAGE_SERVICE_NAME="http"
# Container variables
ENV CTR_USER=nginx \
CTR_USER_ID="999" \
CTR_CMD="nginx" \
CTR_STOPSIGNAL=SIGQUIT
# Component bash variables
ENV NGINX_VERSION="1.18" \
NGINX_VER_SHORT="118" \
NGINX_SYSCONF_PATH=/etc/nginx \
NGINX_MAIN_CONF_FILE=/etc/nginx/nginx.conf \
NGINX_MAIN_CONF_D_PATH=/etc/nginx/conf.d \
NGINX_DEFAULT_CONF_D_PATH=/etc/nginx/default.d \
NGINX_DEFAULT_CONF_ROOT_FILE="/etc/nginx/default.d/root.conf" \
NGINX_DEFAULT_CONF_APP_FILE="/etc/nginx/default.d/app.conf" \
NGINX_VAR_RUN_PATH=/var/run \
NGINX_LIB_PATH=/var/lib/nginx \
NGINX_PORT=${IMAGE_SERVICE_PORT} \
NGINX_LOG_PATH=/var/log/nginx \
APP_DEST=/usr/share/nginx/html
ENV OS_INSTALL_PKGS="nginx"
USER 0
COPY conf/usr/bin /usr/bin/
COPY conf/container-entrypoint.d ${CTR_ENTRYPOINT_OPT_PATH}/
RUN container-setup && container-setup-nginx
WORKDIR ${APP_DEST}
USER ${CTR_USER_ID}
STOPSIGNAL ${CTR_STOPSIGNAL}
EXPOSE ${NGINX_PORT}
CMD ${CTR_CMD}
# Labels
LABEL name="${IMAGE_NAME}" \
summary="${IMAGE_SUMMARY}" \
description="${IMAGE_DESCRIPTION}" \
maintainer="Job Céspedes Ortiz <[email protected]>" \
org.opencontainers.image.title="${IMAGE_TITLE}" \
org.opencontainers.image.authors="Job Céspedes Ortiz <[email protected]>" \
org.opencontainers.image.description="${IMAGE_DESCRIPTION}" \
org.opencontainers.image.version="0.1" \
io.k8s.description="${IMAGE_DESCRIPTION}" \
io.k8s.display-name="${IMAGE_TITLE}" \
io.openshift.expose-services="${IMAGE_SERVICE_PORT}:${IMAGE_SERVICE_NAME}" \
io.openshift.tags="${IMAGE_NAME},nginx,nginx-${NGINX_VER_SHORT},nginx${NGINX_VER_SHORT}"