-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
80 lines (71 loc) · 2.31 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
74
75
76
77
78
79
80
# syntax=docker/dockerfile-upstream:master
# Ubuntu Version, e.g 22.04 unquoted
ARG OS_VERSION
# Optional: Change Timezone
ARG TZ=America/North_Dakota/Center
FROM ubuntu:$OS_VERSION
LABEL org.opencontainers.image.authors="[email protected]"
ARG OS_VERSION
ARG TZ
ENV OCIE_HOME=/etc/ocie \
OCIE_LIB=/usr/lib/ocie \
OCIE_LOG=/var/log/ocie \
WATCHER_ENABLED=1 \
WATCHER_INTERVAL=30
# Set defaults
##############################
ENV APP_NAME="default" \
APP_PARAMS="" \
APP_TYPE="" \
APP_CACHE=/var/cache \
APP_ENV="prod" \
APP_HOME="" \
APP_DATA="" \
APP_GROUP="root" \
APP_OWNER="root" \
APP_DEPLOY=0 \
APP_VOLS="" \
APP_UPDATE_PATH="" \
APP_UPDATE_STRICT=0 \
CA_ENABLED=0 \
CA_PATH="" \
CA_FILTER="*_CA.crt" \
CA_UPDATE_AUTO=1 \
CA_UPDATE_JVM=0 \
CA_UPDATE_OS=0 \
CERT_ENABLED=0 \
CERT_NAME="server" \
CERT_PATH=/etc/ssl \
CERT_SUBJECT="localhost" \
CERT_SIZE=2048 \
CERT_VALID=365 \
CERT_TAG="updated.keys" \
DH_PARAM_SIZE=2048 \
VADC_IP_ADDRESS="10.0.0.0/8 172.16.0.0/12 192.168.0.0/16" \
VADC_IP_HEADER="X-Forwarded-For"
# Add Ocie
COPY --chown=root:root --chmod=0755 ./src/ ./
RUN <<-"EOD" bash
set -eu;
# Set default shell to /bin/bash
ln -sf /bin/bash /bin/sh;
echo "Ocie: Setting up environment";
echo "OCIE_BIN=/usr/sbin" >> /etc/environment;
echo "OCIE_HOME=${OCIE_HOME}" >> /etc/environment;
echo "OCIE_LIB=${OCIE_LIB}" >> /etc/environment;
echo "OS_BASE=${OS_VERSION}" >> /etc/environment;
echo "OS_CODENAME=$(grep -o 'VERSION_CODENAME=.*' </etc/os-release | cut -f2 -d'=')" >> /etc/environment;
echo "OS_IMAGE=ubuntu:${OS_VERSION}" >> /etc/environment;
echo "OS_TIMEZONE=${TZ}" >> /etc/environment;
echo "OS_VERSION=${OS_VERSION//.}" >> /etc/environment;
echo ". /etc/environment" >> /etc/bash.bashrc;
echo "Ocie: Setting up system";
echo "Ocie: Creating container account, [ ocie ]";
mkdir -p ${OCIE_HOME}/conf ${OCIE_LOG};
useradd -d ${OCIE_HOME} -r -s /bin/bash ocie;
install -d -m 0775 -o ocie -g ocie ${OCIE_HOME};
# Install base packages, timezone
ocie --pkg "-base -upgrade" --timezone "-set ${TZ}" --clean "-base" --print;
echo "Ocie: System setup complete";
EOD
CMD ["/bin/bash"]