automation: introduce a new variable to control container user
PATCH 1/1 automation: introduce a new variable to control container user
Sometimes it is handy to create a container and play as root with its setup manually.
--- automation/scripts/containerize | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
automation/scripts/containerize +7 -1
@@ -23,6 +23,12 @@ case "_${CONTAINER}" in _stretch|_) CONTAINER="${BASE}/debian:stretch" ;; esac +# Use this variable to control whehter root should be used +case "_${CONTAINER_ROOT}" in + _1) userarg= ;; + _0|_) userarg="-u $(id -u)" ;; +esac + # Save the commands for future use cmd=$@
@@ -70,7 +76,7 @@ fi # Kick off Docker einfo "*** Launching container ..." exec docker run \ - -u $(id -u) \ + ${userarg} \ ${SSH_AUTH_SOCK:+-e SSH_AUTH_SOCK="/tmp/ssh-agent/${SSH_AUTH_NAME}"} \ -v "${CONTAINER_PATH}":/build:rw \ -v "${HOME}/.ssh":/root/.ssh:ro \
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 13 lines · Wei Liu
Sometimes it is handy to create a container and play as root with its setup manually.
Signed-off-by Wei Liu <[email protected]>--- automation/scripts/containerize | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)automation/scripts/containerize +0
-0
automation/scripts/containerize case "_${CONTAINER}" in · line 30
Quoted 8 lines
automation/scripts/containerize +5
-0@@ -23,6 +23,12 @@ case "_${CONTAINER}" in _stretch|_) CONTAINER="${BASE}/debian:stretch" ;; esac +# Use this variable to control whehter root should be used +case "_${CONTAINER_ROOT}" in + _1) userarg= ;; + _0|_) userarg="-u $(id -u)" ;; +esac
How would you feel about CONTAINER_UID0 instead? I just fear that "ROOT" has quite a few meanings. e.g top of the filesystem? The working dir inside of the container?
Mind documenting this in automation/build/README.md ? I should likely move part of this file that describes the variables up a directory.
--
Doug
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 17 lines · Doug Goldstein
Quoted 16 lines · Wei Liu
Sometimes it is handy to create a container and play as root with its setup manually.
Signed-off-by Wei Liu <[email protected]>--- automation/scripts/containerize | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)automation/scripts/containerize +0
-0@@ -23,6 +23,12 @@ case "_${CONTAINER}" in _stretch|_) CONTAINER="${BASE}/debian:stretch" ;; esac
Quoted 9 lines
automation/scripts/containerize case "_${CONTAINER}" in · line 30
Quoted 5 lines
automation/scripts/containerize +5
-0+# Use this variable to control whehter root should be used +case "_${CONTAINER_ROOT}" in + _1) userarg= ;; + _0|_) userarg="-u $(id -u)" ;; +esacHow would you feel about
CONTAINER_UID0instead? I just fear that "ROOT" has quite a few meanings. e.g top of the filesystem? The working dir inside of the container?
CONTAINER_UID0 is fine.
Quoted 3 lines
Mind documenting this in
automation/build/README.md? I should likely move part of this file that describes the variables up a directory.
Will do.
Wei.
Quoted 3 lines
--
Doug
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel