summaryrefslogtreecommitdiffstats
path: root/lib/container/create
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-06-01 13:23:23 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-06-29 08:46:20 +0000
commit6c75eca760619440013078068d592c5bdc646e87 (patch)
treea5616a206290ffce41af35c9c1c4a06e4c0dbafb /lib/container/create
parentRemoving net-tools from host-setup documentation, it is a direct depends of c... (diff)
downloadcompute-tools-6c75eca760619440013078068d592c5bdc646e87.tar.xz
compute-tools-6c75eca760619440013078068d592c5bdc646e87.zip
Renaming cnt.auto to cnt.container-server in order to split functionality of 'binding container to a specific host system' from 'starting container at system boot'.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'lib/container/create')
-rwxr-xr-xlib/container/create12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/container/create b/lib/container/create
index 1a6f4d5..570492f 100755
--- a/lib/container/create
+++ b/lib/container/create
@@ -27,7 +27,7 @@ SCRIPTS="/usr/share/container-tools/scripts"
Parameters ()
{
- GETOPT_LONGOPTIONS="name:,cnt.auto:,cnt.overlay:,bind:,bind-ro:,capability:,drop-capability:script:,"
+ GETOPT_LONGOPTIONS="name:,cnt.container-server:,cnt.overlay:,bind:,bind-ro:,capability:,drop-capability:script:,"
GETOPT_OPTIONS="n:,b:,c:,d:,s:,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -53,6 +53,11 @@ Parameters ()
shift 2
;;
+ --cnt.container-server)
+ CNT_CONTAINER_SERVER="${2}"
+ shift 2
+ ;;
+
--cnt.overlay)
CNT_OVERLAY="${2}"
shift 2
@@ -98,7 +103,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} -n|--name NAME [--cnt.auto=true|false|FQDN] [--cnt.overlay=DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED] [-b|--bind DIRECTORY:DIRECTORY[:OPTIONS]] [--bind-ro DIRECTORY:DIRECTORY[:OPTIONS]] [-c|--capability CAPABILITY[,CAPABILITY]] [-d|--drop-capability DROP_CAPABILITY[,DROP_CAPABILITY]] [-s|--script SCRIPT] [-- SCRIPT_OPTIONS]" >&2
+ echo "Usage: container ${COMMAND} -n|--name NAME [--cnt.container-server=true|false|FQDN] [--cnt.overlay=DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED] [-b|--bind DIRECTORY:DIRECTORY[:OPTIONS]] [--bind-ro DIRECTORY:DIRECTORY[:OPTIONS]] [-c|--capability CAPABILITY[,CAPABILITY]] [-d|--drop-capability DROP_CAPABILITY[,DROP_CAPABILITY]] [-s|--script SCRIPT] [-- SCRIPT_OPTIONS]" >&2
exit 1
}
@@ -145,7 +150,7 @@ else
fi
fi
-CNT_AUTO="${CNT_AUTO:-$(hostname -f)}"
+CNT_CONTAINER_SERVER="${CNT_CONTAINER_SERVER:-$(hostname -f)}"
# Pre hooks
for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}"
@@ -205,6 +210,7 @@ fi
mkdir -p "${CONFIG}"
sed -e "s|@CNT_AUTO@|${CNT_AUTO}|g" \
+ -e "s|@CNT_CONTAINER_SERVER@|${CNT_CONTAINER_SERVER}|g" \
-e "s|@CNT_NETWORK_BRIDGE@|${CNT_NETWORK_BRIDGE}|g" \
-e "s|@CNT_OVERLAY@|${CNT_OVERLAY}|g" \
-e "s|@NAME@|${NAME}|g" \