-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile.omd-labs-debian
51 lines (42 loc) · 1.85 KB
/
Dockerfile.omd-labs-debian
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
FROM debian:12
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.source="https://github.com/ConSol-Monitoring/omd-labs-docker"
EXPOSE 80 443 22 4730 5666
ENV REFRESHED=20240816
#### user environment ######################################
ENV HOME=/root
WORKDIR $HOME
ADD ./scripts/start.sh $HOME
RUN chmod +x $HOME/start.sh
### OMD installation ######################################
ARG OMD_VERSION
ADD ./scripts/install_*.sh $HOME/
RUN chmod +x $HOME/install_*.sh
RUN $HOME/install_common.sh debian
RUN $HOME/install_omd.sh debian $OMD_VERSION
#### ansible ################################################
COPY ansible_dropin/ansible.cfg /root/ansible_dropin/ansible.cfg
ARG ANSIBLE_DROPIN=$HOME/ansible_dropin
ENV ANSIBLE_DROPIN=$ANSIBLE_DROPIN
ENV ANSIBLE_CONFIG=${ANSIBLE_DROPIN}/ansible.cfg
ENV ANSIBLE_VERBOSITY=0
#### Mount point space requirements (MB)
ARG VOL_ETC_MB_MIN
ARG VOL_LOCAL_MB_MIN
ARG VOL_VAR_MB_MIN
ENV VOL_ETC_MB_MIN=$VOL_ETC_MB_MIN
ENV VOL_LOCAL_MB_MIN=$VOL_LOCAL_MB_MIN
ENV VOL_VAR_MB_MIN=$VOL_VAR_MB_MIN
### -- OMD site creation (DEMO) ##############################
ARG SITENAME=demo
ENV SITENAME=$SITENAME
RUN echo "export SITENAME=$SITENAME" > .sitename.env
RUN sed -i 's|echo "on"$|echo "off"|' /opt/omd/versions/default/lib/omd/hooks/TMPFS
RUN echo "create OMD site: $SITENAME" && omd create -u 1000 -g 1000 $SITENAME
# -- ONBUILD
# when used as a base image, this instructions trigger the creation of another site if NEW_SITENAME is not `demo`
ONBUILD ARG NEW_SITENAME=demo
ONBUILD ENV NEW_SITENAME=$NEW_SITENAME
ONBUILD RUN [ "$NEW_SITENAME" != "demo" ] && echo "export SITENAME=$NEW_SITENAME" > .sitename.env && echo "CREATE new site:$NEW_SITENAME" && omd -f rm $SITENAME && omd create -u 1001 -g 1001 $NEW_SITENAME || true
ENV APACHE_CMD="exec /usr/sbin/apache2ctl -D FOREGROUND"
CMD ["/root/start.sh"]