- Use now rx3-docker/base:1.3.4-mga9 image,

- Fix re-run config bug on a already created container.
This commit is contained in:
Arnaud G. GIBERT 2025-06-26 18:06:22 +02:00
parent 373a9488f1
commit eb3ddcdc0d
4 changed files with 60 additions and 32 deletions

View File

@ -21,12 +21,22 @@ ARG SERVER_PORT_SV_INT
ARG SERVER_LOG_INIT_FILE=${SERVER_LOG_INIT_DIR}/init.log
ARG SERVER_CROND_INI=/etc/supervisord.d/crond.ini
ARG SERVER_DNSMASQ_INI=/etc/supervisord.d/dnsmasq.ini
ARG SERVER_DNSMASQ_CONF=/etc/dnsmasq.conf
ARG SERVER_RESOLV_CONF=/etc/resolv.conf
#-----------------------------------------------------------------------------------------------------------------------
ARG INIT_SHELL='#!/bin/bash \n\
\n\
function log() { echo "$(date --rfc-3339=ns) Init: $*" | tee -a '${SERVER_LOG_INIT_FILE}'; } \n\
. /etc/profile.d/rx3.sh \n\
\n\
\n\
log() { echo "$(date --rfc-3339=ns) Init: $*" | tee -a '${SERVER_LOG_INIT_FILE}'; } \n\
\n\
\n\
log "Starting" \n\
\n\
@ -47,22 +57,39 @@ do
done'
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
ARG CROND='#!/bin/bash \n\
\n\
\n\
if [[ "${SERVER_CROND_ENABLED}" != "TRUE" ]] \n\
then \n\
file_disenable "'${SERVER_CROND_INI}'" FALSE \n\
else \n\
file_disenable "'${SERVER_CROND_INI}'" TRUE \n\
fi'
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
ARG DNSMASQ='#!/bin/bash \n\
\n\
\n\
if [[ "${SERVER_DNS_ENABLED}" != "TRUE" ]] \n\
then \n\
mv /etc/supervisord.d/dnsmasq.ini /etc/supervisord.d/dnsmasq.ini.disabled \n\
file_disenable "'${SERVER_DNSMASQ_INI}'" FALSE \n\
else \n\
echo "" >> /etc/dnsmasq.conf \n\
echo "# Listen local address" >> /etc/dnsmasq.conf \n\
echo "interface=lo" >> /etc/dnsmasq.conf \n\
echo "bind-interfaces" >> /etc/dnsmasq.conf \n\
echo "" >> /etc/dnsmasq.conf \n\
echo "port=53 # DNS only" >> /etc/dnsmasq.conf \n\
echo "no-dhcp-interface= # disables DHCPv4" >> /etc/dnsmasq.conf \n\
echo "" >> /etc/dnsmasq.conf \n\
echo "# Forward local domains" >> /etc/dnsmasq.conf \n\
file_disenable "'${SERVER_DNSMASQ_INI}'" TRUE \n\
\n\
cp '${SERVER_DNSMASQ_CONF}'.dist '${SERVER_DNSMASQ_CONF}' \n\
\n\
echo "" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "# Listen local address" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "interface=lo" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "bind-interfaces" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "port=53 # DNS only" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "no-dhcp-interface= # disables DHCPv4" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "# Forward local domains" >> '${SERVER_DNSMASQ_CONF}' \n\
\n\
for map in ${SERVER_DNS_MAP} \n\
do \n\
@ -74,19 +101,19 @@ else
domain="$1" \n\
server="$2" \n\
\n\
echo "server=/${domain}/${server}" >> /etc/dnsmasq.conf \n\
echo "server=/${domain}/${server}" >> '${SERVER_DNSMASQ_CONF}' \n\
done \n\
\n\
echo "" >> /etc/dnsmasq.conf \n\
echo "# Forward all other queries to default server" >> /etc/dnsmasq.conf \n\
echo "server=${SERVER_DNS_DEFAULT}" >> /etc/dnsmasq.conf \n\
echo "" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "# Forward all other queries to default server" >> '${SERVER_DNSMASQ_CONF}' \n\
echo "server=${SERVER_DNS_DEFAULT}" >> '${SERVER_DNSMASQ_CONF}' \n\
\n\
cp /etc/resolv.conf /etc/resolv.conf.old \n\
\n\
echo "# Generated by DNSMasq init script" > /etc/resolv.conf \n\
echo "" >> /etc/resolv.conf \n\
echo "nameserver 127.0.0.1" >> /etc/resolv.conf \n\
echo "search ${SERVER_DNS_SEARCH}" >> /etc/resolv.conf \n\
echo "# Generated by DNSMasq init script" > '${SERVER_RESOLV_CONF}' \n\
echo "" >> '${SERVER_RESOLV_CONF}' \n\
echo "nameserver 127.0.0.1" >> '${SERVER_RESOLV_CONF}' \n\
echo "search ${SERVER_DNS_SEARCH}" >> '${SERVER_RESOLV_CONF}' \n\
\n\
fi'
#-----------------------------------------------------------------------------------------------------------------------
@ -97,15 +124,6 @@ ARG SUPERVISORD='#!/bin/bash
exec supervisord -c /etc/supervisord.conf'
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
ARG CROND='#!/bin/bash \n\
\n\
if [[ "${SERVER_CROND_ENABLED}" != "TRUE" ]] \n\
then \n\
mv /etc/supervisord.d/crond.ini /etc/supervisord.d/crond.ini.disabled \n\
fi'
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
ARG SUPERVISORD_INI='[inet_http_server] \n\
port=*:'${SERVER_PORT_SV_INT}' \n\
@ -146,7 +164,8 @@ RUN urpmi.update -a
&& ln -s /etc/init.d/supervisord /etc/rcD.d/S99supervisord \
&& echo -e "${CROND_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/crond.ini \
&& echo -e "${DNSMASQ_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/dnsmasq.ini \
&& echo -e "${SUPERVISORD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/supervisord.ini
&& echo -e "${SUPERVISORD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/supervisord.ini \
&& mv "${SERVER_DNSMASQ_CONF}" "${SERVER_DNSMASQ_CONF}.dist"
VOLUME ${SERVER_LOG_INIT_DIR}

View File

@ -5,7 +5,7 @@ Welcome to Rx3-Docker/Server docker image!
This project aims to build a Mageia server docker image to be used by other Rx3 packaging projects.
Features:
- Curtently based on rx3-docker/base:1.3.3-mga9 image,
- Curtently based on rx3-docker/base:1.3.4-mga9 image,
- Init script calling in order sub scripts in /etc/init.d & /etc/rcD.d,
- supervisord managing services,
- crond & logrotate configured & crond disabled by default,

View File

@ -1,3 +1,12 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/Server V 1.2.4 - A. GIBERT - 2025/06/26
------------------------------------------------------------------------------------------------------------------------------------
- Use now rx3-docker/base:1.3.4-mga9 image,
- Fix re-run config bug on a already created container.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/Server V 1.2.3 - A. GIBERT - 2025/05/28
------------------------------------------------------------------------------------------------------------------------------------

View File

@ -18,13 +18,13 @@ ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}"
IMG_NAME="server"
IMG_NAME_FULL="Rx3-Docker/Server Docker Image"
IMG_VERSION="1.2.3-mga9"
IMG_VERSION="1.2.4-mga9"
IMG_MAINTAINER='"Arnaud G. GIBERT" <arnaud@rx3.net>'
IMG_URL_PREFIX="${ORG_URL_PREFIX}"
IMG_URL="${IMG_URL_PREFIX}/${IMG_NAME}:${IMG_VERSION}"
IMG_FROM_URL="${ORG_URL_PREFIX}/base:1.3.3-mga9"
IMG_FROM_URL="${ORG_URL_PREFIX}/base:1.3.4-mga9"