mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-01 23:18:41 +00:00
Add a metadata handler for GCP which allows ssh login
- this needs improvements to make it more "platform native", in particular GCP supports multiple users and more ssh key mangement options. - at present you can login as root with any platform ssh key - add support for uts=host and ipc=host - set the hostname from the metadata as well Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
@@ -30,9 +30,17 @@ docker rm $CONTAINER > /dev/null
|
||||
# remove user namespaces
|
||||
# --read-only sets /dev ro
|
||||
# /sysfs ro unless privileged - cannot detect so will do if grant all caps
|
||||
#
|
||||
# ipc, uts namespaces always isolated
|
||||
|
||||
UTS="."
|
||||
IPC="."
|
||||
echo $ARGS | grep -q uts=host && UTS=".linux.namespaces = (.linux.namespaces|map(select(.type!=\"uts\")))"
|
||||
echo $ARGS | grep -q ipc=host && IPC=".linux.namespaces = (.linux.namespaces|map(select(.type!=\"ipc\")))"
|
||||
|
||||
mv config.json config.json.orig
|
||||
cat config.json.orig | \
|
||||
jq "$UTS" | \
|
||||
jq "$IPC" | \
|
||||
jq 'del(.process.rlimits)' | \
|
||||
jq 'del (.linux.resources.memory.swappiness)' | \
|
||||
jq 'del(.linux.uidMappings) | del(.linux.gidMappings) | .linux.namespaces = (.linux.namespaces|map(select(.type!="user")))' | \
|
||||
|
Reference in New Issue
Block a user