- Add mk_base_image script,
- Add mk_base_image bash completion config, - Add GPL headers, - Add SPEC files to generate docker_tools & docker_tools-devel RPM packages, - Now support rx3-base 1.1.0.
This commit is contained in:
@@ -1,42 +1,76 @@
|
||||
#!/bin/bash
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# Docker Mk Env
|
||||
#
|
||||
# Copyright (C) 2024-2026 Arnaud G. GIBERT
|
||||
# mailto:arnaud@rx3.net
|
||||
#
|
||||
# This is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; If not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# DOCKER_TOOLS_DEBUG= TRUE | FALSE # Enable debugging (Default FALSE)
|
||||
#
|
||||
#
|
||||
# DOCKER_TOOLS_VOLUME= SINGLE | MIXED | MERGED | SPLITED # Default: SPLITED
|
||||
# SINGLE: Merged volume mode + No service suffix
|
||||
# MIXED: Merged volume mode + Init/SV log Service suffix
|
||||
# MERGED: Merged volume mode + Full service suffix
|
||||
# SPLITED: By service volume mode + No service suffix
|
||||
#
|
||||
#
|
||||
# DOCKER_TOOLS_EXEPTION_LIBS="module_name:lib_dir_name ..."
|
||||
# Example: "postgres:pgsq httpd:/var/www/html"
|
||||
#
|
||||
#
|
||||
# DOCKER_TOOLS_EXEPTION_LOGS="module_name:log_dir_name ..."
|
||||
# Example: "postgres:web-server:httpd"
|
||||
#
|
||||
#
|
||||
# DOCKER_TOOLS_USER_GROUP_FORCE= TRUE | FALSE # Force using curent user / group (Default FALSE)
|
||||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
set -o errexit
|
||||
|
||||
if [[ "${DOCKER_TOOLS_DEBUG}" == "TRUE" ]]
|
||||
|
||||
# Include
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
. /usr/lib/rx3/docker_tools.bash
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Init
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
if [[ "${DOCKER_TOOLS_DEBUG:-}" == "TRUE" ]]
|
||||
then
|
||||
set -x
|
||||
fi
|
||||
|
||||
APPL_HOME_DIR="$(dirname "$(dirname "$0")")"
|
||||
DYNVAR_LIST="APPL_HOME_DIR"
|
||||
dt_appl_home_get "${1:-}"
|
||||
|
||||
|
||||
|
||||
DYNVAR_LIST="APPL_HOME_DIR"
|
||||
CONFIG_FILE_LIST=""
|
||||
|
||||
version="$1"
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
function dynvar_export
|
||||
{
|
||||
var=$1
|
||||
@@ -50,7 +84,7 @@ function dynvar_export
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
function psfix_cat
|
||||
{
|
||||
prefix=$1
|
||||
@@ -68,7 +102,7 @@ function psfix_cat
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
function module_lib_name_get
|
||||
{
|
||||
module=$1
|
||||
@@ -87,7 +121,7 @@ function module_lib_name_get
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
function module_log_name_get
|
||||
{
|
||||
module=$1
|
||||
@@ -106,7 +140,7 @@ function module_log_name_get
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
function docker_service_add
|
||||
{
|
||||
varible_prefix="$1"
|
||||
@@ -319,7 +353,7 @@ function docker_service_add
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
function docker_config_add
|
||||
{
|
||||
config_file_target="$1"
|
||||
@@ -331,19 +365,22 @@ function docker_config_add
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Main
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
#version="$1"
|
||||
#
|
||||
#if [[ "${version}" != "" ]]
|
||||
#then
|
||||
# APPL_VERSION="$1"
|
||||
#fi
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
. ${APPL_HOME_DIR}/env
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if [[ "${version}" != "" ]]
|
||||
then
|
||||
APPL_VERSION="$1"
|
||||
fi
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
>${APPL_HOME_DIR}/.env
|
||||
@@ -352,6 +389,11 @@ ENV_NET_SED=""
|
||||
|
||||
for var in $( ( grep "^ *[a-zA-Z0-9_-]*=" ${APPL_HOME_DIR}/env | sed -e "s/=.*//" -e "s/ *//"; echo ${DYNVAR_LIST} | sed -e 's/ /\n/g') | sort -u)
|
||||
do
|
||||
if [[ ! -v ${var} ]]
|
||||
then
|
||||
eval ${var}=""
|
||||
fi
|
||||
|
||||
echo "${var}='${!var}'" >>${APPL_HOME_DIR}/.env
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user