-
Notifications
You must be signed in to change notification settings - Fork 139
/
Copy pathDockerfile
73 lines (63 loc) · 2.65 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
# This image is the base image for all s2i configurable container images.
FROM registry.centos.org/centos/centos:7
ENV SUMMARY="Base image which allows using of source-to-image." \
DESCRIPTION="The s2i-core image provides any images layered on top of it \
with all the tools needed to use source-to-image functionality while keeping \
the image size as small as possible."
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="s2i core" \
io.openshift.s2i.scripts-url=image:///usr/libexec/s2i \
io.s2i.scripts-url=image:///usr/libexec/s2i \
com.redhat.component="s2i-core-container" \
name="centos7/s2i-core-centos7" \
version="1" \
maintainer="SoftwareCollections.org <[email protected]>"
ENV \
# DEPRECATED: Use above LABEL instead, because this will be removed in future versions.
STI_SCRIPTS_URL=image:///usr/libexec/s2i \
# Path to be used in other layers to place s2i scripts into
STI_SCRIPTS_PATH=/usr/libexec/s2i \
APP_ROOT=/opt/app-root \
# The $HOME is not set by default, but some applications needs this variable
HOME=/opt/app-root/src \
PATH=/opt/app-root/src/bin:/opt/app-root/bin:$PATH \
PLATFORM="el7"
# When bash is started non-interactively, to run a shell script, for example it
# looks for this variable and source the content of this file. This will enable
# the SCL for all scripts without need to do 'scl enable'.
ENV BASH_ENV=${APP_ROOT}/etc/scl_enable \
ENV=${APP_ROOT}/etc/scl_enable \
PROMPT_COMMAND=". ${APP_ROOT}/etc/scl_enable"
# This is the list of basic dependencies that all language container image can
# consume.
# Also setup the 'openshift' user that is used for the build execution and for the
# application runtime execution.
# TODO: Use better UID and GID values
RUN rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
INSTALL_PKGS="bsdtar \
findutils \
gettext \
groff-base \
rsync \
scl-utils \
tar \
unzip \
yum-utils" && \
mkdir -p ${HOME}/.pki/nssdb && \
chown -R 1001:0 ${HOME}/.pki && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*'
# Copy extra files to the image.
COPY ./core/root/ /
# Directory with the sources is set as the working directory so all STI scripts
# can execute relative to this path.
WORKDIR ${HOME}
ENTRYPOINT ["container-entrypoint"]
CMD ["base-usage"]
# Reset permissions of modified directories and add default user
RUN rpm-file-permissions && \
useradd -u 1001 -r -g 0 -d ${HOME} -c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT}