added option to use non-default network-interface, resolves #1227 (#1621)

* added option to use non-default network-interface (#1227)
* minor (stylistic) changes
* properly working with Bash arrays for CONTAINER_NETWORKS
* cleanup to trigger rebuild
* added CODE_OF_CONDUCT to trigger rebuild
This commit is contained in:
Georg Lauterbach 2020-09-26 15:11:52 +02:00 committed by GitHub
parent a0791ef457
commit 8e8671bb42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 138 additions and 42 deletions

View file

@ -6,19 +6,19 @@
set -euEo pipefail
trap '_report_err ${_} ${LINENO} ${?}' ERR
function _report_err()
function _report_err
{
echo "ERROR occured :: source ${1} ; line ${2} ; exit code ${3} ;;" >&2
_unset_vars
}
function _unset_vars()
function _unset_vars
{
unset CDIR CRI INFO IMAGE_NAME CONTAINER_NAME DEFAULT_CONFIG_PATH
unset USE_CONTAINER WISHED_CONFIG_PATH CONFIG_PATH VOLUME USE_TTY
}
function _get_current_directory()
function _get_current_directory
{
if dirname "$(readlink -f "${0}")" &>/dev/null
then
@ -44,7 +44,7 @@ CONFIG_PATH=
VOLUME=
USE_TTY=
function _check_root()
function _check_root
{
if [[ ${EUID} -ne 0 ]]
then
@ -53,7 +53,7 @@ function _check_root()
fi
}
function _update_config_path()
function _update_config_path
{
if [[ -n ${CONTAINER_NAME} ]]
then
@ -68,7 +68,7 @@ function _update_config_path()
fi
}
function _inspect()
function _inspect
{
if _docker_image_exists "${IMAGE_NAME}"
then
@ -86,7 +86,7 @@ function _inspect()
fi
}
function _usage()
function _usage
{
echo "Usage: ${0} [-i IMAGE_NAME] [-c CONTAINER_NAME] <subcommand> <subcommand> [args]
@ -141,7 +141,7 @@ SUBCOMMANDS:
"
}
function _docker_image_exists()
function _docker_image_exists
{
if ${CRI} history -q "${1}" >/dev/null 2>&1
then
@ -151,7 +151,7 @@ function _docker_image_exists()
fi
}
function _docker_image()
function _docker_image
{
if ${USE_CONTAINER}
then
@ -171,7 +171,7 @@ function _docker_image()
fi
}
function _docker_container()
function _docker_container
{
if [[ -n ${CONTAINER_NAME} ]]
then
@ -182,7 +182,7 @@ function _docker_container()
fi
}
function _main()
function _main
{
if [[ -n $(command -v docker) ]]
then