-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ubi9-minimal
62 lines (55 loc) · 1.64 KB
/
Dockerfile.ubi9-minimal
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
ARG baseImage
FROM ${baseImage}
#### Labels
## target : define the image purpose
## alm_base / alm_build / alm_release => AzureDevOps agents
## os => base os image
## build => stack build image
## runtime => stack runtime
LABEL target="os"
## stack : define the stack (ex python, tomcat, alm, ...)
LABEL stack="ubi"
## os : define the os
LABEL os="linux"
## description
LABEL description="ubi os image"
#### Envs
## specific
ENV \
APP_ROOT=/opt/app-root \
# The $HOME is not set by default, but some applications needs this variable
HOME=/opt/app-root \
PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
USER=1001 \
PLATFORM="el9"
RUN INSTALL_PKGS="shadow-utils findutils openssl gettext" && \
mkdir -p ${HOME}/.pki/nssdb && \
chown -R ${USER}:0 ${HOME}/.pki && \
microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
microdnf reinstall tzdata -y \
microdnf -y clean all --enablerepo='*'
ENV TZ=Europe/Paris
ENV LANG C.utf8
ENV LC_CTYPE C.utf8
ENV LC_NUMERIC C.utf8
ENV LC_TIME C.utf8
ENV LC_COLLATE C.utf8
ENV LC_MONETARY C.utf8
ENV LC_MESSAGES C.utf8
ENV LC_PAPER C.utf8
ENV LC_NAME C.utf8
ENV LC_ADDRESS C.utf8
ENV LC_TELEPHONE C.utf8
ENV LC_MEASUREMENT C.utf8
ENV LC_IDENTIFICATION C.utf8
ENV LC_ALL C.utf8
# Copy extra files to the image.
COPY ./root/ /
# Reset permissions of modified directories and add default user
RUN chmod +x /usr/bin/rpm-file-permissions && rpm-file-permissions && \
useradd -u ${USER} -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
mkdir -p ${APP_ROOT} && \
chown -R ${USER}:0 ${APP_ROOT}
WORKDIR ${APP_ROOT}