diff --git a/agent/exec/container/container.go b/agent/exec/container/container.go index 8d240cac83..425a4f6ddc 100644 --- a/agent/exec/container/container.go +++ b/agent/exec/container/container.go @@ -230,8 +230,9 @@ func getMountMask(m *api.Mount) string { func (c *containerConfig) hostConfig() *enginecontainer.HostConfig { return &enginecontainer.HostConfig{ - Resources: c.resources(), - Binds: c.binds(), + Resources: c.resources(), + Binds: c.binds(), + Privileged: c.spec().Privileged, } } diff --git a/api/specs.pb.go b/api/specs.pb.go index c8f45105e8..5ece19a634 100644 --- a/api/specs.pb.go +++ b/api/specs.pb.go @@ -436,6 +436,8 @@ type ContainerSpec struct { StopGracePeriod *docker_swarmkit_v11.Duration `protobuf:"bytes,9,opt,name=stop_grace_period,json=stopGracePeriod" json:"stop_grace_period,omitempty"` // PullOptions parameterize the behavior of image pulls. PullOptions *ContainerSpec_PullOptions `protobuf:"bytes,10,opt,name=pull_options,json=pullOptions" json:"pull_options,omitempty"` + // Privileged give extended privileges to the container. + Privileged bool `protobuf:"varint,11,opt,name=Privileged,json=privileged,proto3" json:"Privileged,omitempty"` } func (m *ContainerSpec) Reset() { *m = ContainerSpec{} } @@ -650,6 +652,7 @@ func (m *ContainerSpec) Copy() *ContainerSpec { User: m.User, StopGracePeriod: m.StopGracePeriod.Copy(), PullOptions: m.PullOptions.Copy(), + Privileged: m.Privileged, } if m.Labels != nil { @@ -869,7 +872,7 @@ func (this *ContainerSpec) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 14) + s := make([]string, 0, 15) s = append(s, "&api.ContainerSpec{") s = append(s, "Image: "+fmt.Sprintf("%#v", this.Image)+",\n") keysForLabels := make([]string, 0, len(this.Labels)) @@ -899,6 +902,7 @@ func (this *ContainerSpec) GoString() string { if this.PullOptions != nil { s = append(s, "PullOptions: "+fmt.Sprintf("%#v", this.PullOptions)+",\n") } + s = append(s, "Privileged: "+fmt.Sprintf("%#v", this.Privileged)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -1401,6 +1405,16 @@ func (m *ContainerSpec) MarshalTo(data []byte) (int, error) { } i += n15 } + if m.Privileged { + data[i] = 0x58 + i++ + if m.Privileged { + data[i] = 1 + } else { + data[i] = 0 + } + i++ + } return i, nil } @@ -1803,6 +1817,9 @@ func (m *ContainerSpec) Size() (n int) { l = m.PullOptions.Size() n += 1 + l + sovSpecs(uint64(l)) } + if m.Privileged { + n += 2 + } return n } @@ -2010,6 +2027,7 @@ func (this *ContainerSpec) String() string { `Mounts:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "Mount", 1), `&`, ``, 1) + `,`, `StopGracePeriod:` + strings.Replace(fmt.Sprintf("%v", this.StopGracePeriod), "Duration", "docker_swarmkit_v11.Duration", 1) + `,`, `PullOptions:` + strings.Replace(fmt.Sprintf("%v", this.PullOptions), "ContainerSpec_PullOptions", "ContainerSpec_PullOptions", 1) + `,`, + `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, `}`, }, "") return s @@ -3299,6 +3317,26 @@ func (m *ContainerSpec) Unmarshal(data []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSpecs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := data[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Privileged = bool(v != 0) default: iNdEx = preIndex skippy, err := skipSpecs(data[iNdEx:]) @@ -4021,85 +4059,87 @@ var ( ) var fileDescriptorSpecs = []byte{ - // 1279 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x72, 0x1b, 0xc5, - 0x13, 0xb6, 0xec, 0xb5, 0x2c, 0xf7, 0xda, 0x89, 0x33, 0x95, 0x5f, 0xa2, 0x28, 0xf9, 0xd9, 0x8e, - 0x08, 0x10, 0xa8, 0x42, 0x06, 0x41, 0x25, 0xe1, 0x5f, 0xc1, 0x5a, 0x16, 0x8e, 0x09, 0x76, 0xb6, - 0xc6, 0x49, 0x38, 0xba, 0x46, 0xab, 0x89, 0xbc, 0xe5, 0xd5, 0xce, 0x32, 0x3b, 0x52, 0xca, 0x37, - 0x8e, 0x29, 0x0e, 0xdc, 0xe0, 0x40, 0x15, 0x27, 0xde, 0x81, 0x67, 0xc8, 0x91, 0x1b, 0x9c, 0x52, - 0x24, 0x4f, 0x40, 0x15, 0x2f, 0x40, 0xcf, 0xec, 0x48, 0x5a, 0x91, 0x75, 0xc2, 0xc1, 0x87, 0xad, - 0x9a, 0x3f, 0xdf, 0xf7, 0xf5, 0x4c, 0x77, 0x4f, 0xf7, 0x82, 0x9b, 0x26, 0x3c, 0x48, 0x1b, 0x89, - 0x14, 0x4a, 0x10, 0xd2, 0x15, 0xc1, 0x11, 0x97, 0x8d, 0xf4, 0x11, 0x93, 0xfd, 0xa3, 0x50, 0x35, - 0x86, 0xef, 0xd5, 0x5c, 0x75, 0x9c, 0x70, 0x0b, 0xa8, 0x9d, 0xef, 0x89, 0x9e, 0x30, 0xc3, 0x0d, - 0x3d, 0xb2, 0xab, 0x17, 0xbb, 0x03, 0xc9, 0x54, 0x28, 0xe2, 0x8d, 0xd1, 0x20, 0xdb, 0xa8, 0x7f, - 0xef, 0x40, 0x65, 0x4f, 0x74, 0xf9, 0x3e, 0xda, 0x20, 0xdb, 0xe0, 0xb2, 0x38, 0x16, 0xca, 0x00, - 0xd2, 0x6a, 0x69, 0xbd, 0x74, 0xdd, 0x6d, 0xae, 0x35, 0x5e, 0x34, 0xd9, 0xf0, 0x26, 0xb0, 0x4d, - 0xe7, 0xc9, 0xd3, 0xb5, 0x19, 0x9a, 0x67, 0x92, 0x77, 0xc1, 0x91, 0x22, 0xe2, 0xd5, 0x59, 0x54, - 0x38, 0xd3, 0xbc, 0x52, 0xa4, 0xa0, 0x8d, 0x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0xc6, 0x64, 0x05, 0xe6, 0x78, 0x3c, 0xc4, - 0xeb, 0xe9, 0x25, 0x3d, 0xd4, 0x2b, 0xdd, 0x50, 0x9a, 0xc7, 0x82, 0x2b, 0x38, 0xd4, 0x3c, 0xac, - 0x45, 0x12, 0xdf, 0x80, 0x5e, 0x32, 0x63, 0x72, 0x13, 0xca, 0x7d, 0x81, 0x17, 0x4c, 0x31, 0x89, - 0xf5, 0x61, 0x2f, 0x15, 0x1d, 0x76, 0x57, 0x23, 0x6c, 0x49, 0xb0, 0x70, 0x72, 0x1b, 0xce, 0xa5, - 0x4a, 0x24, 0x07, 0x3d, 0x89, 0xae, 0x3a, 0x48, 0xb8, 0x0c, 0x45, 0xb7, 0xba, 0x78, 0x72, 0x65, - 0xd9, 0xb2, 0x5d, 0x8f, 0x9e, 0xd5, 0xb4, 0x6d, 0xcd, 0xf2, 0x0d, 0x89, 0xf8, 0xb0, 0x94, 0x0c, - 0xa2, 0xe8, 0x40, 0x24, 0x59, 0x81, 0x03, 0x23, 0xf2, 0x1f, 0xbc, 0xe6, 0x23, 0xeb, 0x6e, 0x46, - 0xa2, 0x6e, 0x32, 0x99, 0xd4, 0x3e, 0x04, 0x37, 0xe7, 0x51, 0xed, 0x89, 0x23, 0x7e, 0x6c, 0x83, - 0xa4, 0x87, 0x3a, 0x70, 0x43, 0x16, 0x0d, 0xb2, 0xf6, 0x88, 0x81, 0x33, 0x93, 0x8f, 0x66, 0x6f, - 0x95, 0x6a, 0x4d, 0x70, 0x73, 0xb2, 0xe4, 0x35, 0x58, 0x96, 0xbc, 0x17, 0xa6, 0x28, 0x73, 0xc0, - 0x06, 0xea, 0xb0, 0xfa, 0xb9, 0x21, 0x2c, 0x8d, 0x16, 0x3d, 0x5c, 0xab, 0xff, 0x8d, 0xbd, 0x23, - 0xff, 0xce, 0x49, 0x2b, 0x7b, 0x90, 0xc6, 0xe2, 0x99, 0xe6, 0xc6, 0xab, 0xea, 0x82, 0x49, 0xff, - 0x68, 0x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f, 0x16, 0x16, 0xeb, 0x17, 0x67, 0xaa, 0x9c, 0xf5, - 0xcd, 0xb5, 0x42, 0xb9, 0x31, 0x38, 0xab, 0x88, 0x56, 0x73, 0x85, 0xfd, 0x6b, 0x1d, 0xfb, 0xe3, - 0xb2, 0x90, 0xc1, 0x21, 0x96, 0xcb, 0xec, 0x89, 0xda, 0x16, 0x5f, 0xf8, 0xf3, 0x77, 0x37, 0x0f, - 0xcc, 0xfc, 0x6d, 0x75, 0xa7, 0x35, 0xb0, 0x5d, 0x3b, 0x92, 0x3d, 0x1c, 0xd5, 0xeb, 0xc2, 0xec, - 0xa5, 0xb8, 0x3f, 0x25, 0x61, 0x18, 0xe4, 0x4b, 0x80, 0x6e, 0x98, 0x26, 0x4c, 0xa1, 0x9c, 0xb4, - 0x51, 0x28, 0xbc, 0xe0, 0xd6, 0x18, 0x35, 0xa5, 0x92, 0x63, 0x93, 0x3b, 0xd8, 0xc3, 0xd8, 0x28, - 0x8f, 0xca, 0x27, 0x57, 0xa7, 0x96, 0x67, 0x25, 0x56, 0xb4, 0x04, 0x46, 0xb4, 0x32, 0x5a, 0xa1, - 0x95, 0x80, 0xd9, 0xbd, 0x2b, 0x4f, 0x9e, 0xad, 0xce, 0xfc, 0x81, 0xdf, 0x5f, 0xcf, 0x56, 0x4b, - 0xdf, 0x3e, 0x5f, 0x2d, 0x3d, 0xc1, 0xef, 0x37, 0xfc, 0xfe, 0xc4, 0xaf, 0x53, 0x36, 0xbf, 0xf3, - 0xef, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x66, 0xa6, 0x7e, 0x2d, 0x0c, 0x00, 0x00, + // 1297 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6e, 0xdb, 0x46, + 0x13, 0xb7, 0x6c, 0x5a, 0xa6, 0x87, 0x76, 0xe2, 0x2c, 0xf2, 0x25, 0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6e, + 0x09, 0x01, 0x07, 0x4b, 0x22, 0xc3, 0x50, 0x68, 0xb3, 0x59, 0x93, 0x15, 0x98, 0xe3, 0xf1, 0x10, + 0x3f, 0x4f, 0x9b, 0xf4, 0x52, 0x5b, 0xba, 0x42, 0x9a, 0xcb, 0x82, 0x16, 0x5c, 0x6a, 0x1e, 0xf6, + 0x22, 0x89, 0x77, 0x40, 0x9b, 0xcc, 0x9a, 0xdc, 0x84, 0x6a, 0x3f, 0xc1, 0x0f, 0xcc, 0xb0, 0x88, + 0xf5, 0x61, 0x2f, 0x95, 0x1d, 0x76, 0x57, 0x23, 0x6c, 0x4b, 0xb0, 0x70, 0x72, 0x1b, 0xce, 0x65, + 0x2a, 0x49, 0x0f, 0x7a, 0x12, 0x43, 0x75, 0x90, 0x72, 0x29, 0x92, 0x6e, 0x6d, 0xf1, 0xf4, 0xce, + 0xb2, 0x65, 0xa7, 0x1e, 0x3d, 0xab, 0x69, 0xdb, 0x9a, 0x15, 0x18, 0x12, 0x09, 0x60, 0x29, 0x1d, + 0x44, 0xd1, 0x41, 0x92, 0xe6, 0x0d, 0x0e, 0x8c, 0xc8, 0xbf, 0x88, 0x5a, 0x80, 0xac, 0xbb, 0x39, + 0x89, 0x7a, 0xe9, 0x64, 0x43, 0x56, 0x01, 0x02, 0x29, 0x86, 0x22, 0xe2, 0x3d, 0x6c, 0x58, 0x1e, + 0xea, 0xb9, 0x14, 0xd2, 0xb1, 0xa5, 0xfe, 0x21, 0x78, 0x85, 0x88, 0xeb, 0x48, 0x1d, 0xf3, 0x13, + 0x9b, 0x44, 0xbd, 0xd4, 0x89, 0x1d, 0xb2, 0x68, 0x90, 0x8f, 0x4f, 0x4c, 0xac, 0xd9, 0x7c, 0x34, + 0x7b, 0xab, 0x52, 0x6f, 0x81, 0x57, 0x70, 0x4b, 0xfe, 0x07, 0xcb, 0x92, 0xf7, 0x44, 0x86, 0x32, + 0x07, 0x6c, 0xa0, 0x8e, 0x6a, 0x9f, 0x1b, 0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b/api/specs.proto index b012ec6611..a418881f2f 100644 --- a/api/specs.proto +++ b/api/specs.proto @@ -175,6 +175,9 @@ message ContainerSpec { // PullOptions parameterize the behavior of image pulls. PullOptions pull_options = 10; + + // Privileged give extended privileges to the container. + bool Privileged = 11; } // EndpointSpec defines the properties that can be configured to diff --git a/cmd/swarmctl/service/flagparser/container.go b/cmd/swarmctl/service/flagparser/container.go index 029cfc49c4..27907f1b4f 100644 --- a/cmd/swarmctl/service/flagparser/container.go +++ b/cmd/swarmctl/service/flagparser/container.go @@ -38,5 +38,13 @@ func parseContainer(flags *pflag.FlagSet, spec *api.ServiceSpec) error { spec.Task.GetContainer().Env = env } + if flags.Changed("privileged") { + privileged, err := flags.GetBool("privileged") + if err != nil { + return err + } + spec.Task.GetContainer().Privileged = privileged + } + return nil } diff --git a/cmd/swarmctl/service/flagparser/flags.go b/cmd/swarmctl/service/flagparser/flags.go index 248dc010f9..ba96ae9606 100644 --- a/cmd/swarmctl/service/flagparser/flags.go +++ b/cmd/swarmctl/service/flagparser/flags.go @@ -20,6 +20,7 @@ func AddServiceFlags(flags *pflag.FlagSet) { flags.StringSlice("command", nil, "override entrypoint") flags.StringSlice("args", nil, "container args") flags.StringSlice("env", nil, "container env") + flags.BoolP("privileged", "", false, "give extended privileges to container (default false)") flags.StringSlice("ports", nil, "ports") flags.String("network", "", "network name")