summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKatharina Drexel <katharina.drexel@bfh.ch>2020-10-06 14:45:24 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2020-10-30 04:03:20 +0000
commitb0a490647fc1256dc72a067b0100d709017094e0 (patch)
treee6b765d786485d35e69d88dbb062a2143ec22861 /lib
parentAdding overlay options to container configuration file. (diff)
downloadcompute-tools-b0a490647fc1256dc72a067b0100d709017094e0.tar.xz
compute-tools-b0a490647fc1256dc72a067b0100d709017094e0.zip
Adding overlay options to container create command.
Signed-off-by: Katharina Drexel <katharina.drexel@bfh.ch> Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/container/create10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/container/create b/lib/container/create
index a07525a..519a815 100755
--- a/lib/container/create
+++ b/lib/container/create
@@ -31,7 +31,7 @@ CONFIG_TEMPLATE="/usr/share/${PROJECT}/${PROGRAM}/config/container.conf.in"
Parameters ()
{
- GETOPT_LONGOPTIONS="name:,cnt.container-server:,cnt.overlay:,bind:,bind-ro:,capability:,drop-capability:,script:,verbose,"
+ GETOPT_LONGOPTIONS="name:,cnt.container-server:,cnt.overlay:,cnt.overlay-options:,bind:,bind-ro:,capability:,drop-capability:,script:,verbose,"
GETOPT_OPTIONS="n:,b:,c:,d:,s:,v,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -67,6 +67,11 @@ Parameters ()
shift 2
;;
+ --cnt.overlay-options)
+ CNT_OVERLAY_OPTIONS="${2}"
+ shift 2
+ ;;
+
-b|--bind)
BIND="${2}"
shift 2
@@ -112,7 +117,7 @@ Parameters ()
Usage ()
{
- echo "Usage: ${PROGRAM} ${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] [-v|--verbose] [-- SCRIPT_OPTIONS]" >&2
+ echo "Usage: ${PROGRAM} ${COMMAND} -n|--name NAME [--cnt.container-server=true|false|FQDN] [--cnt.overlay=DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED] [--cnt.overlay-options=OPTION[,OPTION]] [-b|--bind DIRECTORY:DIRECTORY[:OPTIONS]] [--bind-ro DIRECTORY:DIRECTORY[:OPTIONS]] [-c|--capability CAPABILITY[,CAPABILITY]] [-d|--drop-capability DROP_CAPABILITY[,DROP_CAPABILITY]] [-s|--script SCRIPT] [-v|--verbose] [-- SCRIPT_OPTIONS]" >&2
exit 1
}
@@ -241,6 +246,7 @@ 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|@CNT_OVERLAY_OPTIONS@|${CNT_OVERLAY_OPTIONS}|g" \
-e "s|@NAME@|${NAME}|g" \
-e "s|@BIND@|${BIND}|g" \
-e "s|@BIND_RO@|${BIND_RO}|g" \