diff options
author | Katharina Drexel <katharina.drexel@bfh.ch> | 2020-10-06 14:45:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2020-10-30 04:03:20 +0000 |
commit | b0a490647fc1256dc72a067b0100d709017094e0 (patch) | |
tree | e6b765d786485d35e69d88dbb062a2143ec22861 | |
parent | Adding overlay options to container configuration file. (diff) | |
download | compute-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>
-rwxr-xr-x | lib/container/create | 10 | ||||
-rw-r--r-- | share/man/container-create.1.txt | 3 |
2 files changed, 11 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" \ diff --git a/share/man/container-create.1.txt b/share/man/container-create.1.txt index 7770d9b..2ba95de 100644 --- a/share/man/container-create.1.txt +++ b/share/man/container-create.1.txt @@ -67,6 +67,9 @@ The following container-create options are available: *--cnt-overlay='DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED[;DIRECTORY_UPPER:DIRECTORY_LOWER:DIRECTORY_WORK:DIRECTORY_MERGED]'*:: Specify container overlay mounts, see Documentation/filesystems/overlayfs.txt. +*--cnt.overlay-options='OPTION1,OPTION2[;OPTION3,OPTION4]'*:: + Specify container overlay mount options, see Documentation/filesystems/overlayfs.txt. + SCRIPTS ------- |