From c4c7c1e8d802522a56236a49d3a8b7a2b6cfe9e7 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Thu, 16 Mar 2017 11:29:21 +0000 Subject: [PATCH] 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 --- config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 2a32c1002..db004a29c 100644 --- a/config.go +++ b/config.go @@ -46,10 +46,11 @@ type MobyImage struct { NetworkMode string `yaml:"network_mode"` Pid string Ipc string + Uts string ReadOnly bool `yaml:"read_only"` } -const riddler = "mobylinux/riddler:7d4545d8b8ac2700971a83f12a3446a76db28c14@sha256:11b7310df6482fc38aa52b419c2ef1065d7b9207c633d47554e13aa99f6c0b72" +const riddler = "mobylinux/riddler:8fe62ff02b9d28767554105b55d4613db3e77429@sha256:42b7f5c81fb85f8afb17548e00e5b81cfa4818c192e1199d61850491a178b0da" // NewConfig parses a config file func NewConfig(config []byte) (*Moby, error) { @@ -91,6 +92,10 @@ func ConfigToRun(order int, path string, image *MobyImage) []string { // TODO only "host" supported args = append(args, "--ipc="+image.Ipc) } + if image.Uts != "" { + // TODO only "host" supported + args = append(args, "--uts="+image.Uts) + } for _, bind := range image.Binds { args = append(args, "-v", bind) }