6466N/A Dockerfile.solaris | 26 +
6466N/A api/client/run.go | 1 +
7068N/A api/client/version.go | 20 -
6466N/A api/server/server_unix.go | 2 +-
7119N/A container/container_solaris.go | 650 ++++++++++++
6872N/A container/monitor.go | 9 +
6466N/A contrib/mkimage.sh | 11 +
6466N/A contrib/mkimage/solaris | 120 +++
6466N/A daemon/commit.go | 22 +-
6466N/A daemon/config.go | 4 +
6466N/A daemon/config_solaris.go | 66 ++
6466N/A daemon/config_test.go | 30 +-
6466N/A daemon/container_operations_solaris.go | 973 ++++++++++++++++++
7068N/A daemon/daemon.go | 6 +-
7305N/A daemon/daemon_solaris.go | 576 +++++++++++
6466N/A daemon/daemon_test.go | 2 +
6466N/A daemon/exec_solaris.go | 18 +
7267N/A daemon/execdriver/zones/driver.go | 799 +++++++++++++++
6466N/A daemon/graphdriver/zfs/zfs.go | 47 +-
7068N/A daemon/info.go | 2 -
6466N/A daemon/inspect_solaris.go | 30 +
6466N/A daemon/inspect_unix.go | 2 +-
6466N/A daemon/list_unix.go | 2 +-
6466N/A daemon/network.go | 7 +
7171N/A daemon/start.go | 16 +
7068N/A daemon/stats_collector_solaris.go | 537 ++++++++++
7068N/A daemon/stats_solaris.go | 84 ++
6466N/A docker/daemon_solaris.go | 58 ++
6466N/A docker/daemon_unix.go | 2 +-
6466N/A hack/.vendor-helpers.sh | 8 +-
6466N/A hack/make.sh | 14 +-
7232N/A integration-cli/docker_cli_run_test.go | 341 +++---
6466N/A .../docker_cli_start_volume_driver_unix_test.go | 16 +-
6466N/A layer/layer_unix.go | 2 +-
6466N/A opts/hosts.go | 3 -
6466N/A opts/hosts_solaris.go | 10 +
6466N/A opts/hosts_test.go | 4 +-
6466N/A opts/hosts_unix.go | 6 +-
6466N/A pkg/archive/archive_test.go | 38 +-
6466N/A pkg/archive/changes_test.go | 12 +-
6466N/A pkg/integration/utils_test.go | 11 +-
6466N/A pkg/mount/mount.go | 3 +-
6466N/A pkg/sysinfo/sysinfo_solaris.go | 117 +++
7068N/A pkg/system/meminfo_solaris.go | 127 +++
6466N/A pkg/system/stat_linux.go | 33 -
6466N/A pkg/system/stat_solaris.go | 20 +-
6466N/A pkg/system/stat_unix.go | 35 +
6466N/A pkg/term/tc_other.go | 1 +
6466N/A pkg/term/tc_solaris_cgo.go | 60 ++
6466N/A pkg/term/term.go | 22 -
6466N/A pkg/term/term_solaris.go | 39 +
6466N/A pkg/term/term_unix.go | 27 +
6466N/A registry/auth_test.go | 2 +
7232N/A .../libnetwork/drivers/solaris/bridge/bridge.go | 1084 ++++++++++++++++++++
6466N/A .../drivers/solaris/bridge/bridge_store.go | 212 ++++
7232N/A .../libnetwork/drivers/solaris/bridge/errors.go | 341 ++++++
7368N/A .../drivers/solaris/bridge/port_mapping.go | 247 +++++
6466N/A .../docker/libnetwork/drivers_solaris.go | 13 +
6466N/A .../portallocator/portallocator_linux.go | 28 +
7232N/A .../docker/libnetwork/portmapper/mapper.go | 228 ----
7232N/A .../docker/libnetwork/portmapper/mapper_linux.go | 228 ++++
6466N/A .../docker/libnetwork/portmapper/mapper_solaris.go | 150 +++
6466N/A .../docker/libnetwork/portmapper/proxy.go | 209 ----
6466N/A .../docker/libnetwork/portmapper/proxy_linux.go | 209 ++++
6466N/A .../mistifyio/go-zfs/utils_notsolaris.go | 82 ++
6466N/A .../mistifyio/go-zfs/zpool_notsolaris.go | 33 +
6466N/A .../runc/libcontainer/console_solaris.go | 13 +
6466N/A .../runc/libcontainer/zones/stats.go | 86 ++
6466N/A vendor/src/gopkg.in/fsnotify.v1/fen.go | 188 ++++
6466N/A create mode 100644 Dockerfile.solaris
6466N/A create mode 100644 container/container_solaris.go
6466N/A create mode 100644 container/state_solaris.go
6466N/A create mode 100755 contrib/mkimage/solaris
6466N/A create mode 100644 daemon/config_solaris.go
6466N/A create mode 100644 daemon/container_operations_solaris.go
6466N/A create mode 100644 daemon/daemon_solaris.go
6466N/A create mode 100644 daemon/exec_solaris.go
6466N/A create mode 100644 daemon/execdriver/driver_solaris.go
6466N/A create mode 100644 daemon/execdriver/execdrivers/execdrivers_solaris.go
6466N/A create mode 100644 daemon/execdriver/zones/driver.go
6466N/A create mode 100644 daemon/execdriver/zones/driver_unsupported.go
6466N/A create mode 100644 daemon/execdriver/zones/driver_unsupported_nocgo.go
6466N/A create mode 100644 daemon/graphdriver/driver_solaris.go
6466N/A create mode 100644 daemon/graphdriver/zfs/zfs_solaris.go
6466N/A create mode 100644 daemon/inspect_solaris.go
6466N/A create mode 100644 daemon/stats_collector_solaris.go
6466N/A create mode 100644 daemon/stats_solaris.go
6466N/A create mode 100644 docker/daemon_solaris.go
6466N/A create mode 100644 opts/hosts_solaris.go
6466N/A create mode 100644 pkg/fileutils/fileutils_solaris.go
6466N/A create mode 100644 pkg/mount/flags_solaris.go
6466N/A create mode 100644 pkg/mount/mounter_solaris.go
6466N/A create mode 100644 pkg/mount/mountinfo_solaris.go
6466N/A create mode 100644 pkg/parsers/kernel/uname_solaris.go
6466N/A create mode 100644 pkg/parsers/operatingsystem/operatingsystem_solaris.go
6466N/A create mode 100644 pkg/platform/architecture_solaris.go
6466N/A create mode 100644 pkg/reexec/command_solaris.go
6466N/A create mode 100644 pkg/signal/signal_solaris.go
6466N/A create mode 100644 pkg/sysinfo/sysinfo_solaris.go
6466N/A create mode 100644 pkg/system/meminfo_solaris.go
6466N/A delete mode 100644 pkg/system/stat_linux.go
6466N/A create mode 100644 pkg/system/stat_unix.go
6466N/A create mode 100644 pkg/term/tc_solaris_cgo.go
6466N/A create mode 100644 pkg/term/term_solaris.go
6466N/A create mode 100644 pkg/term/term_unix.go
6466N/A create mode 100644 runconfig/hostconfig_solaris.go
6466N/A create mode 100644 vendor/src/github.com/Sirupsen/logrus/terminal_solaris.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/default_gateway_solaris.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/bridge.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/bridge_store.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/errors.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/port_mapping.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/drivers_solaris.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/ipamutils/utils_solaris.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/osl/interface_solaris.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/osl/namespace_solaris.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/osl/neigh_solaris.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/portallocator/portallocator_linux.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/portallocator/portallocator_solaris.go
6466N/A delete mode 100644 vendor/src/github.com/docker/libnetwork/portmapper/mapper.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/portmapper/mapper_linux.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/portmapper/mapper_solaris.go
6466N/A delete mode 100644 vendor/src/github.com/docker/libnetwork/portmapper/mock_proxy.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/portmapper/mock_proxy_linux.go
6466N/A delete mode 100644 vendor/src/github.com/docker/libnetwork/portmapper/proxy.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/portmapper/proxy_linux.go
6466N/A create mode 100644 vendor/src/github.com/docker/libnetwork/sandbox_externalkey_solaris.go
6466N/A create mode 100644 vendor/src/github.com/mistifyio/go-zfs/utils_notsolaris.go
6466N/A create mode 100644 vendor/src/github.com/mistifyio/go-zfs/utils_solaris.go
6466N/A create mode 100644 vendor/src/github.com/mistifyio/go-zfs/zfs_notsolaris.go
6466N/A create mode 100644 vendor/src/github.com/mistifyio/go-zfs/zfs_solaris.go
6466N/A create mode 100644 vendor/src/github.com/mistifyio/go-zfs/zpool_notsolaris.go
6466N/A create mode 100644 vendor/src/github.com/mistifyio/go-zfs/zpool_solaris.go
6466N/A create mode 100644 vendor/src/github.com/opencontainers/runc/libcontainer/configs/cgroup_solaris.go
6466N/A create mode 100644 vendor/src/github.com/opencontainers/runc/libcontainer/console_solaris.go
6466N/A create mode 100644 vendor/src/github.com/opencontainers/runc/libcontainer/container_solaris.go
6466N/A create mode 100644 vendor/src/github.com/opencontainers/runc/libcontainer/stats_solaris.go
6466N/A create mode 100644 vendor/src/github.com/opencontainers/runc/libcontainer/zones/stats.go
6466N/A create mode 100644 vendor/src/gopkg.in/fsnotify.v1/fen.go
6466N/A create mode 100644 vendor/src/gopkg.in/fsnotify.v1/fen_cgo.go
6466N/Aindex 0000000..a4ad4d4
6466N/A+# docker build -t docker:solaris -f Dockerfile.solaris .
6466N/A+# docker run --rm docker:solaris hack/make.sh dynbinary
6466N/A+# docker run --rm -v /var/lib/docker docker:solaris hack/dind hack/make.sh dynbinary test-integration-cli ( NOT TESTED )
6466N/A+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
6466N/A+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
6466N/A+ library/golang/* \
6466N/A+ENV DOCKER_CROSSPLATFORMS solaris/amd64
6466N/Aindex 7a66015..c218458 100644
6466N/A DOCKERFILE := Dockerfile.armhf
6466N/A ifeq ($(DOCKER_OSARCH), linux/arm64)
6466N/A- DOCKERFILE := Dockerfile.armhf
6466N/A+ DOCKERFILE := Dockerfile.aarch64
6466N/A ifeq ($(DOCKER_OSARCH), linux/ppc64le)
6466N/A DOCKERFILE := Dockerfile.ppc64le
6466N/A ifeq ($(DOCKER_OSARCH), linux/s390x)
6466N/A DOCKERFILE := Dockerfile.s390x
6466N/A+ifeq ($(DOCKER_OSARCH), windows/amd64)
6466N/A+ DOCKERFILE := Dockerfile.windows
6466N/A+ifeq ($(DOCKER_OSARCH), solaris/amd64)
6466N/A+ DOCKERFILE := Dockerfile.solaris
6466N/A # `docs/sources/contributing/devenvironment.md ` and `project/PACKAGERS.md` have some limited documentation of some of these
6466N/A $(DOCKER_RUN_DOCKER) hack/make.sh binary
6466N/A+ $(DOCKER_RUN_DOCKER) hack/make.sh dynbinary
6466N/A+ $(DOCKER_RUN_DOCKER) hack/make.sh gccgo
6466N/A $(DOCKER_RUN_DOCKER) hack/make.sh dynbinary build-rpm
6466N/A $(DOCKER_RUN_DOCKER) hack/make.sh test-unit
6466N/A- $(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet validate-vendor
6466N/A+ $(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-default-seccomp validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet validate-vendor
6466N/A if !config.Tty {
7068N/A Version: {{.Client.Version}}
7068N/A API version: {{.Client.APIVersion}}
7068N/A Go version: {{.Client.GoVersion}}
7068N/A- Git commit: {{.Client.GitCommit}}
7068N/A- Built: {{.Client.BuildTime}}
7068N/A Experimental: {{.Client.Experimental}}{{end}}{{if .ServerOK}}
7068N/A Version: {{.Server.Version}}
7068N/A API version: {{.Server.APIVersion}}
7068N/A Go version: {{.Server.GoVersion}}
7068N/A- Git commit: {{.Server.GitCommit}}
7068N/A- Built: {{.Server.BuildTime}}
7068N/A Experimental: {{.Server.Experimental}}{{end}}{{end}}`
7068N/A Version: dockerversion.Version,
7068N/A APIVersion: cli.client.ClientVersion(),
7068N/A GoVersion: runtime.Version(),
7068N/A- GitCommit: dockerversion.GitCommit,
7068N/A- BuildTime: dockerversion.BuildTime,
7068N/A Os: runtime.GOOS,
7068N/A Arch: runtime.GOARCH,
7068N/A Experimental: utils.ExperimentalBuild(),
7068N/A- if vd.ServerOK() {
6466N/Adiff --git a/api/server/router/container/container_routes.go b/api/server/router/container/container_routes.go
6466N/Aindex 4e2ffca..e58405b 100644
6466N/A+ elapsed := time.Since(start)
6466N/A+ fmt.Printf("%s took %s time\n", name, elapsed)
6466N/A func (s *containerRouter) getContainersJSON(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
6466N/A if err := httputils.ParseForm(r); err != nil {
6466N/A@@ -159,6 +164,7 @@ func (s *containerRouter) getContainersExport(ctx context.Context, w http.Respon
6466N/A func (s *containerRouter) postContainersStart(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
6466N/A@@ -356,6 +362,7 @@ func (s *containerRouter) postContainerUpdate(ctx context.Context, w http.Respon
6466N/A func (s *containerRouter) postContainersCreate(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
6466N/A if err := httputils.ParseForm(r); err != nil {
6466N/Aindex a4fc639..ea647ff 100644
6466N/A+ runconfigopts "github.com/docker/docker/runconfig/opts"
6466N/A+ containertypes "github.com/docker/engine-api/types/container"
6466N/A+ // DefaultSHMSize is the default size (64MB) of the SHM which will be mounted in the container
6466N/A+ fullHostname := container.Config.Hostname
6466N/A+ if container.Config.Domainname != "" {
6466N/A+ "PATH=" + system.DefaultPathEnv,
6466N/A+ if container.Config.Tty {
6466N/A+ if destination == "/etc/resolv.conf" {
6466N/A+ container.ResolvConfPath = path
6466N/A+ if destination == "/etc/hostname" {
6466N/A+ container.HostnamePath = path
6466N/A+ if destination == "/etc/hosts" {
6466N/A+ container.HostsPath = path
6466N/A+ hostnamePath, err := container.GetRootResourcePath("hostname")
6466N/A+ container.HostnamePath = hostnamePath
6466N/A+ if container.Config.Domainname != "" {
6466N/A+ return ioutil.WriteFile(container.HostnamePath, []byte(fmt.Sprintf("%s.%s\n", container.Config.Hostname, container.Config.Domainname)), 0644)
6466N/A+ return ioutil.WriteFile(container.HostnamePath, []byte(container.Config.Hostname+"\n"), 0644)
6466N/A+func (container *Container) GetEndpointInNetwork(n libnetwork.Network) (libnetwork.Endpoint, error) {
6466N/A+ return n.EndpointByName(endpointName)
6466N/A+func (container *Container) buildPortMapInfo(ep libnetwork.Endpoint) error {
6466N/A+ return derr.ErrorCodeEmptyEndpoint
6466N/A+ networkSettings := container.NetworkSettings
6466N/A+ return derr.ErrorCodeEmptyNetwork
6466N/A+ if len(networkSettings.Ports) == 0 {
6466N/A+ networkSettings.Ports = pm
6466N/A+func appendNetworkMounts(container *Container, volumeMounts []volume.MountPoint) ([]volume.MountPoint, error) {
6466N/A+ for _, mnt := range container.NetworkMounts() {
6466N/A+ volumeMounts = append(volumeMounts, volume.MountPoint{Destination: dest})
6466N/A+ pm := nat.PortMap{}
6466N/A+ for _, ep := range sb.Endpoints() {
6466N/A+ pm := nat.PortMap{}
6466N/A+ driverInfo, err := ep.DriverInfo()
6466N/A+ if expData, ok := driverInfo[netlabel.ExposedPorts]; ok {
6466N/A+ if exposedPorts, ok := expData.([]types.TransportPort); ok {
6466N/A+ mapData, ok := driverInfo[netlabel.PortMap]
6466N/A+ if portMapping, ok := mapData.([]types.PortBinding); ok {
6466N/A+ natBndg := nat.PortBinding{HostIP: pp.HostIP.String(), HostPort: strconv.Itoa(int(pp.HostPort))}
6466N/A+// BuildEndpointInfo sets endpoint-related fields on container.NetworkSettings based on the provided network and endpoint.
6466N/A+func (container *Container) BuildEndpointInfo(n libnetwork.Network, ep libnetwork.Endpoint) error {
6466N/A+ return derr.ErrorCodeEmptyEndpoint
6466N/A+ networkSettings := container.NetworkSettings
6466N/A+ return derr.ErrorCodeEmptyNetwork
6466N/A+ iface := epInfo.Iface()
6466N/A+ if iface.MacAddress() != nil {
6466N/A+ if iface.Address() != nil {
6466N/A+func (container *Container) UpdateJoinInfo(n libnetwork.Network, ep libnetwork.Endpoint) error {
6466N/A+ if err := container.buildPortMapInfo(ep); err != nil {
6466N/A+ if epInfo.Gateway() != nil {
6466N/A+ if epInfo.GatewayIPv6().To16() != nil {
6466N/A+func (container *Container) UpdateSandboxNetworkSettings(sb libnetwork.Sandbox) error {
6466N/A+func (container *Container) BuildJoinOptions(n libnetwork.Network) ([]libnetwork.EndpointOption, error) {
6466N/A+ var joinOptions []libnetwork.EndpointOption
6466N/A+ for _, str := range epConfig.Links {
6466N/A+ name, alias, err := runconfigopts.ParseLink(str)
6466N/A+ joinOptions = append(joinOptions, libnetwork.CreateOptionAlias(name, alias))
6466N/A+func (container *Container) BuildCreateEndpointOptions(n libnetwork.Network, epConfig *network.EndpointSettings, sb libnetwork.Sandbox) ([]libnetwork.EndpointOption, error) {
6466N/A+ portSpecs = make(nat.PortSet)
6466N/A+ bindings = make(nat.PortMap)
6466N/A+ pbList []types.PortBinding
6466N/A+ exposeList []types.TransportPort
6466N/A+ createOptions []libnetwork.EndpointOption
6466N/A+ createOptions = append(createOptions, libnetwork.CreateOptionAnonymous())
6466N/A+ ipam := epConfig.IPAMConfig
6466N/A+ libnetwork.CreateOptionIpam(net.ParseIP(ipam.IPv4Address), net.ParseIP(ipam.IPv6Address), nil))
6466N/A+ for _, alias := range epConfig.Aliases {
6466N/A+ createOptions = append(createOptions, libnetwork.CreateOptionMyAlias(alias))
6466N/A+ createOptions = append(createOptions, libnetwork.CreateOptionDisableResolution())
6466N/A+ if container.Config.MacAddress != "" {
6466N/A+ genericOption := options.Generic{
6466N/A+ netlabel.MacAddress: mac,
6466N/A+ createOptions = append(createOptions, libnetwork.EndpointOptionGeneric(genericOption))
6466N/A+ if container.Config.ExposedPorts != nil {
6466N/A+ portSpecs = container.Config.ExposedPorts
6466N/A+ if container.HostConfig.PortBindings != nil {
6466N/A+ for p, b := range container.HostConfig.PortBindings {
6466N/A+ bindings[p] = []nat.PortBinding{}
6466N/A+ bindings[p] = append(bindings[p], nat.PortBinding{
6466N/A+ HostPort: bb.HostPort,
6466N/A+ nat.SortPortMap(ports, bindings)
6466N/A+ expose := types.TransportPort{}
6466N/A+ pbCopy := pb.GetCopy()
6466N/A+ portStart, portEnd, err = newP.Range()
6466N/A+ return nil, derr.ErrorCodeHostPort.WithArgs(binding[i].HostPort, err)
6466N/A+ pbCopy.HostPort = uint16(portStart)
6466N/A+ pbCopy.HostPortEnd = uint16(portEnd)
6466N/A+ if container.HostConfig.PublishAllPorts && len(binding) == 0 {
6466N/A+ libnetwork.CreateOptionPortMapping(pbList),
6466N/A+ libnetwork.CreateOptionExposedPorts(exposeList))
6466N/A+// SetupWorkingDirectory sets up the container's working directory as set in container.Config.WorkingDir
6466N/A+ if container.Config.WorkingDir == "" {
6466N/A+ if !os.IsNotExist(err) {
6466N/A+ if err := system.MkdirAll(pth, 0755); err != nil {
6466N/A+ if pthInfo != nil && !pthInfo.IsDir() {
6466N/A+func (container *Container) NetworkMounts() []execdriver.Mount {
6466N/A+ var mounts []execdriver.Mount
6466N/A+ shared := container.HostConfig.NetworkMode.IsContainer()
6466N/A+ if container.ResolvConfPath != "" {
6466N/A+ logrus.Warnf("ResolvConfPath set to %q, but can't stat this filename (err = %v); skipping", container.ResolvConfPath, err)
6466N/A+ writable := !container.HostConfig.ReadonlyRootfs
6466N/A+ mounts = append(mounts, execdriver.Mount{
6466N/A+ Source: container.ResolvConfPath,
6466N/A+ Destination: "/etc/resolv.conf",
6466N/A+ Propagation: volume.DefaultPropagationMode,
6466N/A+ if container.HostnamePath != "" {
6466N/A+ logrus.Warnf("HostnamePath set to %q, but can't stat this filename (err = %v); skipping", container.HostnamePath, err)
6466N/A+ writable := !container.HostConfig.ReadonlyRootfs
6466N/A+ mounts = append(mounts, execdriver.Mount{
6466N/A+ Source: container.HostnamePath,
6466N/A+ Destination: "/etc/hostname",
6466N/A+ Propagation: volume.DefaultPropagationMode,
6466N/A+ if container.HostsPath != "" {
6466N/A+ logrus.Warnf("HostsPath set to %q, but can't stat this filename (err = %v); skipping", container.HostsPath, err)
6466N/A+ writable := !container.HostConfig.ReadonlyRootfs
6466N/A+ mounts = append(mounts, execdriver.Mount{
6466N/A+ Source: container.HostsPath,
6466N/A+ Destination: "/etc/hosts",
6466N/A+ Propagation: volume.DefaultPropagationMode,
6466N/A+func (container *Container) CopyImagePathContent(v volume.Volume, destination string) error {
6466N/A+ rootfs, err := symlink.FollowSymlinkInScope(filepath.Join(container.BaseFS, destination), container.BaseFS)
6466N/A+ if _, err = ioutil.ReadDir(rootfs); err != nil {
6466N/A+ if os.IsNotExist(err) {
6466N/A+ return container.GetRootResourcePath("shm")
6466N/A+ return container.GetRootResourcePath("mqueue")
6466N/A+ _, exists := container.MountPoints[path]
6466N/A+func (container *Container) IpcMounts() []execdriver.Mount {
6466N/A+func (container *Container) UpdateContainer(hostConfig *containertypes.HostConfig) error {
6466N/A+ return unix.Unmount(path, 0)
6466N/A+func (container *Container) UnmountVolumes(forceSyscall bool, volumeEventLog func(name, action string, attributes map[string]string)) error {
6466N/A+ volumeMounts []volume.MountPoint
6466N/A+ for _, mntPoint := range container.MountPoints {
6466N/A+ volumeMounts = append(volumeMounts, volume.MountPoint{Destination: dest, Volume: mntPoint.Volume})
6466N/A+ if err := detachMounted(volumeMount.Destination); err != nil {
6466N/A+ if volumeMount.Volume != nil {
6466N/A+ if err := volumeMount.Volume.Unmount(); err != nil {
6466N/A+ "driver": volumeMount.Volume.DriverName(),
6466N/A+ "container": container.ID,
6466N/A+ volumeEventLog(volumeMount.Volume.Name(), "unmount", attributes)
6466N/A+ volList, err := ioutil.ReadDir(source)
6466N/A+ srcList, err := ioutil.ReadDir(destination)
6466N/A+ if err := chrootarchive.CopyWithTar(source, destination); err != nil {
6466N/A+ stat, err := system.Stat(source)
6466N/A+func (container *Container) TmpfsMounts() []execdriver.Mount {
6466N/A+ var mounts []execdriver.Mount
6724N/A if m.container.RestartCount == 0 {
6466N/A m.resetContainer(false)
6724N/A+ if m.container.Running {
6466N/A+func (s *State) setFromExitStatus(exitStatus *execdriver.ExitStatus) {
6466N/Adiff --git a/contrib/docker-device-tool/device_tool.go b/contrib/docker-device-tool/device_tool.go
6466N/Aindex 3976d72..d59315f 100755
6466N/A echo >&2 " $mkimg -t someuser/centos:5 rinse --distribution centos-5"
6466N/A echo >&2 " $mkimg -t someuser/mageia:4 mageia-urpmi --version=4"
6466N/A echo >&2 " $mkimg -t someuser/mageia:4 mageia-urpmi --version=4 --mirror=http://somemirror/"
6466N/A+ echo >&2 " $mkimg -t someuser/solaris12 solaris"
6466N/A+[[ $os == "Solaris" ]] && export PATH=/usr/gnu/bin:$PATH
6466N/A+[[ $os == "Solaris" && $EUID != "0" ]] && echo >&2 "image create on Solaris requires superuser privilege"
6466N/A optTemp=$(getopt --options '+d:t:c:hC' --longoptions 'dir:,tag:,compression:,no-compression,help' --name "$mkimg" -- "$@")
6466N/A+#!/usr/bin/env bash
6466N/A+ --facet facet.locale.*=false \
6466N/A+ --facet facet.locale.POSIX=true \
6466N/A+ --facet facet.doc.*=false \
6466N/A+# XXX For now inject useful configuration for testing, but this should eventually be in Docker
6466N/A+mkdir -p $rootfsDir/etc/svc/profile/sysconfig
6466N/A+cat > "$rootfsDir/etc/svc/profile/sysconfig/container_sc.xml" <<-'EOF'
6466N/A+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
6466N/A+ <service version="1" type="service" name="system/name-service/switch">
6466N/A+ <service version="1" type="service" name="network/dns/client">
6466N/A+ <value_node value="us.oracle.com"/>
6466N/A+ REPO_DB=/system/volatile/repository.$$
6466N/A+ export SVCCFG_DOOR_PATH=$rootfsDir/system/volatile/tmp_repo_door
6466N/A+ for m in $rootfsDir/lib/svc/manifest/system/environment.xml \
6466N/A+ svccfg apply $rootfsDir/etc/svc/profile/generic_container.xml
6466N/A+ svccfg apply $rootfsDir/etc/svc/profile/sysconfig/container_sc.xml
6466N/A+ for s in svc:/system/svc/restarter \
6466N/A+ svc:/system/environment \
6466N/A+ svc:/network/dns/client \
6466N/A+ svc:/system/svc/global \
6466N/A+ svc:/milestone/container ;do
6466N/A+ mv $REPO_DB $rootfsDir/etc/svc/repository.db
6466N/A+cat > "$rootfsDir/usr/bin/pkg" <<-'EOF'
6466N/A+/usr/lib/zones/zoneproxy-client -s localhost:1008
6466N/A+chmod +x "$rootfsDir/usr/bin/pkg"
6466N/Aindex d0c4924..ecdc316 100644
6466N/A@@ -95,14 +95,18 @@ func merge(userConf, imageConf *containertypes.Config) error {
6466N/A func (daemon *Daemon) Commit(name string, c *types.ContainerCommitConfig) (string, error) {
6466N/A container, err := daemon.GetContainer(name)
6466N/A- return "", fmt.Errorf("Windows does not support commit of a running container")
6466N/A@@ -136,6 +140,11 @@ func (daemon *Daemon) Commit(name string, c *types.ContainerCommitConfig) (strin
6466N/A history = img.History
6466N/A rootFS = img.RootFS
6466N/A+ OStype = runtime.GOOS
6466N/A@@ -161,10 +170,11 @@ func (daemon *Daemon) Commit(name string, c *types.ContainerCommitConfig) (strin
6466N/A V1Image: image.V1Image{
6466N/A- DockerVersion: dockerversion.Version,
6466N/A- Architecture: runtime.GOARCH,
6466N/A- OS: runtime.GOOS,
6466N/A+ DockerVersion: dockerversion.Version,
6466N/A+ Architecture: runtime.GOARCH,
6466N/A Container: container.ID,
6466N/A ContainerConfig: *container.Config,
6466N/Aindex 8e063c0..cf22934 100644
6466N/A+ if runtime.GOOS == "solaris" && clusterAdvertise != "" || clusterStore != "" {
6466N/A+ return "", fmt.Errorf("Cluster Advertise Settings not supported on Solaris\n")
6466N/A+ defaultPidFile = "/system/volatile/docker/docker.pid"
6466N/A+ defaultGraph = "/var/lib/docker"
6466N/A+// Subsequent calls to `flag.Parse` will populate config with values parsed
6466N/A+func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) string) {
6466N/A+ config.InstallCommonFlags(cmd, usageFn)
6466N/A+ cmd.StringVar(&config.SocketGroup, []string{"G", "-group"}, "docker", usageFn("Group for the unix socket"))
6466N/A+ //cmd.BoolVar(&config.bridgeConfig.EnableIPMasq, []string{"-ip-masq"}, true, usageFn("Enable IP masquerading"))
6466N/A+ cmd.StringVar(&config.bridgeConfig.IP, []string{"#bip", "-bip"}, "", usageFn("Specify network bridge IP"))
6466N/A+ cmd.StringVar(&config.bridgeConfig.Iface, []string{"b", "-bridge"}, "", usageFn("Attach containers to a network bridge"))
6466N/A+ cmd.StringVar(&config.bridgeConfig.FixedCIDR, []string{"-fixed-cidr"}, "", usageFn("IPv4 subnet for fixed IPs"))
6466N/A+ //cmd.StringVar(&config.bridgeConfig.FixedCIDRv6, []string{"-fixed-cidr-v6"}, "", usageFn("IPv6 subnet for fixed IPs"))
6466N/A+ cmd.Var(opts.NewIPOpt(&config.bridgeConfig.DefaultGatewayIPv4, ""), []string{"-default-gateway"}, usageFn("Container default gateway IPv4 address"))
6466N/A+ //cmd.Var(opts.NewIPOpt(&config.bridgeConfig.DefaultGatewayIPv6, ""), []string{"-default-gateway-v6"}, usageFn("Container default gateway IPv6 address"))
6466N/A+ cmd.BoolVar(&config.bridgeConfig.InterContainerCommunication, []string{"#icc", "-icc"}, true, usageFn("Enable inter-container communication"))
6466N/A+ cmd.Var(opts.NewIPOpt(&config.bridgeConfig.DefaultIP, "0.0.0.0"), []string{"#ip", "-ip"}, usageFn("Default IP when binding container ports"))
6466N/A+ //cmd.BoolVar(&config.bridgeConfig.EnableUserlandProxy, []string{"-userland-proxy"}, true, usageFn("Use userland proxy for loopback traffic"))
6466N/A+ config.attachExperimentalFlags(cmd, usageFn)
6466N/Aindex dc1c3bc..beb2eb0 100644
6466N/A+ containertypes "github.com/docker/engine-api/types/container"
6466N/A+ networktypes "github.com/docker/engine-api/types/network"
6466N/A+ solarisbridge "github.com/docker/libnetwork/drivers/solaris/bridge"
6466N/A+func (daemon *Daemon) setupLinkedContainers(container *container.Container) ([]string, error) {
6466N/A+ children := daemon.children(container)
6466N/A+ bridgeSettings := container.NetworkSettings.Networks["bridge"]
6466N/A+ if !child.IsRunning() {
6466N/A+ return nil, fmt.Errorf("Cannot link to a non running container: %s AS %s", child.Name, linkAlias)
6466N/A+ childBridgeSettings := child.NetworkSettings.Networks["bridge"]
6466N/A+ link := links.NewLink(
6466N/A+ for _, envVar := range link.ToEnv() {
6466N/A+func (daemon *Daemon) populateCommand(c *container.Container, env []string) error {
6466N/A+ var en *execdriver.Network
6466N/A+ if !c.Config.NetworkDisabled {
6466N/A+ en = &execdriver.Network{
6466N/A+ nc, err := daemon.getNetworkedContainer(c.ID, c.HostConfig.NetworkMode.ConnectedContainer())
6466N/A+ nmode := c.HostConfig.NetworkMode
6466N/A+ return fmt.Errorf("invalid network mode: %s", nmode)
6466N/A+ addr := c.Config.IPAddress
6466N/A+ defrouter := c.Config.Defrouter
6466N/A+ if nmode.IsDefault() {
6466N/A+ nname = nmode.NetworkName()
6466N/A+ n := c.NetworkSettings.Networks[nname]
6466N/A+ bridge = solarisbridge.DefaultBridgeName
6466N/A+ fmt.Printf("nname:%s, addr:%s, mac:%s, defrouter:%s, bridge:%s\n",
6466N/A+ resources := &execdriver.Resources{
6466N/A+ CommonResources: execdriver.CommonResources{
6466N/A+ Memory: c.HostConfig.Memory,
6466N/A+ MemoryReservation: c.HostConfig.MemoryReservation,
6466N/A+ CPUShares: c.HostConfig.CPUShares,
6466N/A+ BlkioWeight: c.HostConfig.BlkioWeight,
6466N/A+ MemorySwap: c.HostConfig.MemorySwap,
6466N/A+ CpusetCpus: c.HostConfig.CpusetCpus,
6466N/A+ CpusetMems: c.HostConfig.CpusetMems,
6466N/A+ CPUQuota: c.HostConfig.CPUQuota,
6466N/A+ processConfig := execdriver.ProcessConfig{
6466N/A+ CommonProcessConfig: execdriver.CommonProcessConfig{
6466N/A+ Tty: c.Config.Tty,
6466N/A+ User: c.Config.User,
6466N/A+ processConfig.Env = env
6466N/A+ CommonCommand: execdriver.CommonCommand{
6466N/A+ MountLabel: c.GetMountLabel(),
6466N/A+ ProcessLabel: c.GetProcessLabel(),
6466N/A+ WorkingDir: c.Config.WorkingDir,
6466N/A+ Arch: img.Architecture,
6466N/A+ ReadonlyRootfs: c.HostConfig.ReadonlyRootfs,
6466N/A+ ShmSize: &c.HostConfig.ShmSize,
6466N/A+ LimitPriv: c.HostConfig.LimitPriv,
6466N/A+func (daemon *Daemon) getSize(container *container.Container) (int64, int64) {
6466N/A+ if err := daemon.Mount(container); err != nil {
6466N/A+ defer daemon.Unmount(container)
6466N/A+ sizeRw, err = container.RWLayer.Size()
6466N/A+ logrus.Errorf("Driver %s couldn't return diff size of container %s: %s",
6466N/A+ if parent := container.RWLayer.Parent(); parent != nil {
6466N/A+ sizeRootfs, err = parent.Size()
6466N/A+func (daemon *Daemon) buildSandboxOptions(container *container.Container, n libnetwork.Network) ([]libnetwork.SandboxOption, error) {
6466N/A+ sboxOptions []libnetwork.SandboxOption
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionUseDefaultSandbox())
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionOriginResolvConfPath("/etc/resolv.conf"))
6466N/A+ } else if daemon.execDriver.SupportsHooks() {
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionUseExternalKey())
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionResolvConfPath(container.ResolvConfPath))
6466N/A+ if len(container.HostConfig.DNS) > 0 {
6466N/A+ dns = container.HostConfig.DNS
6466N/A+ } else if len(daemon.configStore.DNS) > 0 {
6466N/A+ dns = daemon.configStore.DNS
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionDNS(d))
6466N/A+ if len(container.HostConfig.DNSSearch) > 0 {
6466N/A+ dnsSearch = container.HostConfig.DNSSearch
6466N/A+ } else if len(daemon.configStore.DNSSearch) > 0 {
6466N/A+ dnsSearch = daemon.configStore.DNSSearch
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionDNSSearch(ds))
6466N/A+ if len(container.HostConfig.DNSOptions) > 0 {
6466N/A+ dnsOptions = container.HostConfig.DNSOptions
6466N/A+ } else if len(daemon.configStore.DNSOptions) > 0 {
6466N/A+ dnsOptions = daemon.configStore.DNSOptions
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionDNSOptions(ds))
6466N/A+ if container.NetworkSettings.SecondaryIPAddresses != nil {
6466N/A+ name := container.Config.Hostname
6466N/A+ if container.Config.Domainname != "" {
6466N/A+ name = name + "." + container.Config.Domainname
6466N/A+ for _, a := range container.NetworkSettings.SecondaryIPAddresses {
6466N/A+ for _, extraHost := range container.HostConfig.ExtraHosts {
6466N/A+ parts := strings.SplitN(extraHost, ":", 2)
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionExtraHost(parts[0], parts[1]))
6466N/A+ ep, _ := container.GetEndpointInNetwork(n)
6466N/A+ children := daemon.children(container)
6466N/A+ return nil, fmt.Errorf("Cannot link to %s, as it does not belong to the default network", child.Name)
6466N/A+ _, alias := path.Split(linkAlias)
6466N/A+ aliasList := alias + " " + child.Config.Hostname
6466N/A+ if alias != child.Name[1:] {
6466N/A+ aliasList = aliasList + " " + child.Name[1:]
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionExtraHost(aliasList, child.NetworkSettings.Networks["bridge"].IPAddress))
6466N/A+ cEndpoint, _ := child.GetEndpointInNetwork(n)
6466N/A+ if cEndpoint != nil && cEndpoint.ID() != "" {
6466N/A+ childEndpoints = append(childEndpoints, cEndpoint.ID())
6466N/A+ bridgeSettings := container.NetworkSettings.Networks["bridge"]
6466N/A+ for alias, parent := range daemon.parents(container) {
6466N/A+ _, alias = path.Split(alias)
6466N/A+ logrus.Debugf("Update /etc/hosts of %s for alias %s with ip %s", parent.ID, alias, bridgeSettings.IPAddress)
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionParentUpdate(
6466N/A+ linkOptions := options.Generic{
6466N/A+ sboxOptions = append(sboxOptions, libnetwork.OptionGeneric(linkOptions))
6466N/A+func (daemon *Daemon) updateNetworkSettings(container *container.Container, n libnetwork.Network) error {
6466N/A+ if container.NetworkSettings == nil {
6466N/A+ container.NetworkSettings = &network.Settings{Networks: make(map[string]*networktypes.EndpointSettings)}
6466N/A+ if !container.HostConfig.NetworkMode.IsHost() && containertypes.NetworkMode(n.Type()).IsHost() {
6466N/A+ for s := range container.NetworkSettings.Networks {
6466N/A+ sn, err := daemon.FindNetwork(s)
6466N/A+func (daemon *Daemon) updateEndpointNetworkSettings(container *container.Container, n libnetwork.Network, ep libnetwork.Endpoint) error {
6466N/A+ if err := container.BuildEndpointInfo(n, ep); err != nil {
6466N/A+// get removed/unlinked).
6466N/A+func (daemon *Daemon) updateNetwork(container *container.Container) error {
6466N/A+ ctrl := daemon.netController
6466N/A+ sb, err := ctrl.SandboxByID(sid)
6466N/A+ return derr.ErrorCodeNoSandbox.WithArgs(sid, err)
6466N/A+ var n libnetwork.Network
6466N/A+ for name := range container.NetworkSettings.Networks {
6466N/A+ sn, err := daemon.FindNetwork(name)
6466N/A+ options, err := daemon.buildSandboxOptions(container, n)
6466N/A+ return derr.ErrorCodeNetworkUpdate.WithArgs(err)
6466N/A+ if err := sb.Refresh(options...); err != nil {
6466N/A+ return derr.ErrorCodeNetworkRefresh.WithArgs(sid, err)
6466N/A+func (daemon *Daemon) updateContainerNetworkSettings(container *container.Container, endpointsConfig map[string]*networktypes.EndpointSettings) error {
6466N/A+ mode := container.HostConfig.NetworkMode
6466N/A+ networkName := mode.NetworkName()
6466N/A+ if mode.IsDefault() {
6466N/A+ if mode.IsUserDefined() {
6466N/A+ n, err = daemon.FindNetwork(networkName)
6466N/A+ if container.NetworkSettings == nil {
6466N/A+ container.NetworkSettings.Networks = endpointsConfig
6466N/A+ if container.NetworkSettings.Networks == nil {
6466N/A+ if !mode.IsUserDefined() {
6466N/A+ if _, ok := container.NetworkSettings.Networks[networkName]; ok {
6466N/A+ container.NetworkSettings.Networks[networkName] = nwConfig
6466N/A+func (daemon *Daemon) allocateNetwork(container *container.Container) error {
6466N/A+ controller := daemon.netController
6466N/A+ if len(container.NetworkSettings.Networks) == 0 {
6466N/A+ err := daemon.updateContainerNetworkSettings(container, nil)
6466N/A+ for n, nConf := range container.NetworkSettings.Networks {
6466N/A+ if err := daemon.connectToNetwork(container, n, nConf, updateSettings); err != nil {
6466N/A+ return container.WriteHostConfig()
6466N/A+// hasUserDefinedIPAddress returns whether the passed endpoint configuration contains IP address configuration
6466N/A+func hasUserDefinedIPAddress(epConfig *networktypes.EndpointSettings) bool {
6466N/A+ return epConfig != nil && epConfig.IPAMConfig != nil && (len(epConfig.IPAMConfig.IPv4Address) > 0 || len(epConfig.IPAMConfig.IPv6Address) > 0)
6466N/A+func validateNetworkingConfig(n libnetwork.Network, epConfig *networktypes.EndpointSettings) error {
6466N/A+ subnetConfigs []*libnetwork.IpamConf
6466N/A+ ipConfigured: len(epConfig.IPAMConfig.IPv4Address) > 0,
6466N/A+ ipConfigured: len(epConfig.IPAMConfig.IPv6Address) > 0,
6466N/A+ if s.ipConfigured {
6466N/A+ for _, cfg := range s.subnetConfigs {
6466N/A+ if len(cfg.PreferredPool) > 0 {
6466N/A+func cleanOperationalData(es *networktypes.EndpointSettings) {
6466N/A+ es.EndpointID = ""
6466N/A+ es.Gateway = ""
6466N/A+ es.IPAddress = ""
6466N/A+ es.IPPrefixLen = 0
6466N/A+ es.IPv6Gateway = ""
6466N/A+ es.GlobalIPv6Address = ""
6466N/A+ es.MacAddress = ""
6466N/A+func (daemon *Daemon) getNetworkSandbox(container *container.Container) libnetwork.Sandbox {
6466N/A+ var sb libnetwork.Sandbox
6466N/A+// hasUserDefinedIPAddress returns whether the passed endpoint configuration contains IP address configuration
6466N/A+func (daemon *Daemon) updateNetworkConfig(container *container.Container, idOrName string, endpointConfig *networktypes.EndpointSettings, updateSettings bool) (libnetwork.Network, error) {
6466N/A+ return nil, runconfig.ErrConflictSharedNetwork
6466N/A+ if containertypes.NetworkMode(idOrName).IsBridge() &&
6466N/A+ if !containertypes.NetworkMode(idOrName).IsUserDefined() {
6466N/A+ return nil, runconfig.ErrUnsupportedNetworkAndIP
6466N/A+ if endpointConfig != nil && len(endpointConfig.Aliases) > 0 {
6466N/A+ return nil, runconfig.ErrUnsupportedNetworkAndAlias
6466N/A+ n, err := daemon.FindNetwork(idOrName)
6466N/A+ if err := daemon.updateNetworkSettings(container, n); err != nil {
6466N/A+func (daemon *Daemon) ConnectToNetwork(container *container.Container, idOrName string, endpointConfig *networktypes.EndpointSettings) error {
6466N/A+ if !container.Running {
6466N/A+ return errRemovalContainer(container.ID)
6466N/A+ if _, err := daemon.updateNetworkConfig(container, idOrName, endpointConfig, true); err != nil {
6466N/A+ container.NetworkSettings.Networks[idOrName] = endpointConfig
6466N/A+ if err := daemon.connectToNetwork(container, idOrName, endpointConfig, true); err != nil {
6466N/A+ if err := container.ToDiskLocking(); err != nil {
6466N/A+ return fmt.Errorf("Error saving container to disk: %v", err)
6466N/A+func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName string, endpointConfig *networktypes.EndpointSettings, updateSettings bool) (err error) {
6466N/A+ n, err := daemon.updateNetworkConfig(container, idOrName, endpointConfig, updateSettings)
6466N/A+ controller := daemon.netController
6466N/A+ sb := daemon.getNetworkSandbox(container)
6466N/A+ createOptions, err := container.BuildCreateEndpointOptions(n, endpointConfig, sb)
6466N/A+ ep, err := n.CreateEndpoint(endpointName, createOptions...)
6466N/A+ logrus.Warnf("Could not rollback container connection to network %s", idOrName)
6466N/A+ if err := daemon.updateEndpointNetworkSettings(container, n, ep); err != nil {
6466N/A+ options, err := daemon.buildSandboxOptions(container, n)
6466N/A+ joinOptions, err := container.BuildJoinOptions(n)
6466N/A+ if err := container.UpdateJoinInfo(n, ep); err != nil {
6466N/A+ return derr.ErrorCodeJoinInfo.WithArgs(err)
6466N/A+ daemon.LogNetworkEventWithAttributes(n, "connect", map[string]string{"container": container.ID})
6466N/A+func (daemon *Daemon) ForceEndpointDelete(name string, n libnetwork.Network) error {
6466N/A+ ep, err := n.EndpointByName(name)
6466N/A+func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, n libnetwork.Network, force bool) error {
6466N/A+ if container.HostConfig.NetworkMode.IsHost() && containertypes.NetworkMode(n.Type()).IsHost() {
6466N/A+ if !container.Running {
6466N/A+ return errRemovalContainer(container.ID)
6466N/A+ return fmt.Errorf("container %s is not connected to the network %s", container.ID, n.Name())
6466N/A+ if err := container.ToDiskLocking(); err != nil {
6466N/A+ return fmt.Errorf("Error saving container to disk: %v", err)
6466N/A+ "container": container.ID,
6466N/A+ daemon.LogNetworkEventWithAttributes(n, "disconnect", attributes)
6466N/A+func disconnectFromNetwork(container *container.Container, n libnetwork.Network, force bool) error {
6466N/A+ sbox libnetwork.Sandbox
6466N/A+ s := func(current libnetwork.Endpoint) bool {
6466N/A+ epInfo := current.Info()
6466N/A+ if sb := epInfo.Sandbox(); sb != nil {
6466N/A+ ep, err := n.EndpointByName(epName)
6466N/A+ return fmt.Errorf("container %s failed to leave network %s: %v", container.ID, n.Name(), err)
6466N/A+ return fmt.Errorf("endpoint delete failed for container %s on network %s: %v", container.ID, n.Name(), err)
6466N/A+func (daemon *Daemon) initializeNetworking(container *container.Container) error {
6466N/A+ nc, err := daemon.getNetworkedContainer(container.ID, container.HostConfig.NetworkMode.ConnectedContainer())
6466N/A+ container.Config.Hostname = parts[0]
6466N/A+ container.Config.Domainname = parts[1]
6466N/A+ if err := daemon.allocateNetwork(container); err != nil {
6466N/A+ return container.BuildHostnameFile()
6466N/A+ var sandbox libnetwork.Sandbox
6466N/A+ search := libnetwork.SandboxContainerWalker(&sandbox, containerID)
6466N/A+ return fmt.Errorf("error locating sandbox id %s: no sandbox found", containerID)
6466N/A+ return sandbox.SetKey(path)
6466N/A+func (daemon *Daemon) getIpcContainer(container *container.Container) (*container.Container, error) {
6466N/A+ containerID := container.HostConfig.IpcMode.Container()
6466N/A+ c, err := daemon.GetContainer(containerID)
6466N/A+ if !c.IsRunning() {
6466N/A+ return nil, fmt.Errorf("cannot join IPC of a non running container: %s", containerID)
6466N/A+ if c.IsRestarting() {
6466N/A+ return nil, derr.ErrorCodeIPCRunning.WithArgs(containerID)
6466N/A+func (daemon *Daemon) releaseNetwork(container *container.Container) {
6466N/A+ settings := container.NetworkSettings.Networks
6466N/A+ var networks []libnetwork.Network
6466N/A+ if nw, err := daemon.FindNetwork(n); err == nil {
6466N/A+ sb, err := daemon.netController.SandboxByID(sid)
6466N/A+ logrus.Errorf("error locating sandbox id %s: %v", sid, err)
6466N/A+ "container": container.ID,
6466N/A+ daemon.LogNetworkEventWithAttributes(nw, "disconnect", attributes)
6466N/A+func (daemon *Daemon) getNetworkedContainer(containerID, connectedContainerID string) (*container.Container, error) {
6466N/A+ nc, err := daemon.GetContainer(connectedContainerID)
6466N/A+ return nil, derr.ErrorCodeJoinSelf
6466N/A+ if !nc.IsRunning() {
6466N/A+ return nil, derr.ErrorCodeJoinRunning.WithArgs(connectedContainerID)
6466N/A+func (daemon *Daemon) setupIpcDirs(container *container.Container) error {
6466N/A+func (daemon *Daemon) mountVolumes(container *container.Container) error {
6466N/A+ mounts, err := daemon.setupMounts(container)
6466N/A+ var stat os.FileInfo
6466N/A+ if m.Writable {
6466N/A+func killProcessDirectly(container *container.Container) error {
6466N/A+func isLinkable(child *container.Container) bool {
6466N/A+ _, ok := child.NetworkSettings.Networks["bridge"]
6466N/A+ return fmt.Errorf("Container %s is marked for removal and cannot be connected or disconnected to the network", containerID)
7068N/Aindex 6cb7f8c..f360392 100644
6466N/A@@ -766,7 +766,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
6466N/A sysInfo := sysinfo.New(false)
6466N/A // on Linux/FreeBSD.
6466N/A+ if runtime.GOOS != "windows" && runtime.GOOS != "solaris" && !sysInfo.CgroupDevicesEnabled {
6466N/A return nil, fmt.Errorf("Devices cgroup isn't mounted")
6466N/A@@ -912,10 +912,12 @@ func (daemon *Daemon) Mount(container *container.Container) error {
6466N/A-func (daemon *Daemon) Unmount(container *container.Container) {
6466N/A+func (daemon *Daemon) Unmount(container *container.Container) error {
6466N/A if err := container.RWLayer.Unmount(); err != nil {
7305N/Aindex 0000000..a73cbb8
7305N/A+ runconfigopts "github.com/docker/docker/runconfig/opts"
6466N/A+ containertypes "github.com/docker/engine-api/types/container"
6466N/A+ nwconfig "github.com/docker/libnetwork/config"
6466N/A+func parseSecurityOpt(container *container.Container, config *containertypes.HostConfig) error {
6466N/A+ Since config.SecurityOpt is specifically defined as a "List of string values to
6466N/A+ for _, _ = range config.SecurityOpt {
6466N/A+ fmt.Errorf("Security options are not supported on Solaris\n")
6466N/A+func (daemon *Daemon) adaptContainerSettings(hostConfig *containertypes.HostConfig, adjustCPUShares bool) error {
6466N/A+ if hostConfig.CPUShares < 0 {
6466N/A+ logrus.Warnf("Changing requested CPUShares of %d to minimum allowed of %d", hostConfig.CPUShares, solarisMinCPUShares)
6466N/A+ hostConfig.CPUShares = solarisMinCPUShares
6466N/A+ } else if hostConfig.CPUShares > solarisMaxCPUShares {
6466N/A+ logrus.Warnf("Changing requested CPUShares of %d to maximum allowed of %d", hostConfig.CPUShares, solarisMaxCPUShares)
6466N/A+ hostConfig.CPUShares = solarisMaxCPUShares
6466N/A+ if hostConfig.ShmSize != 0 {
6466N/A+ shmSize := container.DefaultSHMSize
6466N/A+ hostConfig.ShmSize = shmSize
6466N/A+ if hostConfig.OomKillDisable == nil {
6466N/A+ hostConfig.OomKillDisable = &defaultOomKillDisable
6466N/A+func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.HostConfig, config *containertypes.Config) ([]string, error) {
6466N/A+ sysInfo := sysinfo.New(true)
6466N/A+ warnings = append(warnings, "Your kernel does not support memory limit capabilities. Limitation discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.")
6466N/A+ hostConfig.Memory = 0
6466N/A+ hostConfig.MemorySwap = -1
6466N/A+ warnings = append(warnings, "Your kernel does not support swap limit capabilities, memory limited without swap.")
6466N/A+ logrus.Warnf("Your kernel does not support swap limit capabilities, memory limited without swap.")
6466N/A+ hostConfig.MemorySwap = -1
6466N/A+ if hostConfig.Memory > 0 && hostConfig.MemorySwap > 0 && hostConfig.MemorySwap < hostConfig.Memory {
6466N/A+ return warnings, fmt.Errorf("Minimum memoryswap limit should be larger than memory limit, see usage.")
6466N/A+ if hostConfig.MemorySwappiness != nil && *hostConfig.MemorySwappiness != -1 && !sysInfo.MemorySwappiness {
6466N/A+ warnings = append(warnings, "Your kernel does not support memory swappiness capabilities, memory swappiness discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support memory swappiness capabilities, memory swappiness discarded.")
6466N/A+ warnings = append(warnings, "Your kernel does not support memory soft limit capabilities. Limitation discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support memory soft limit capabilities. Limitation discarded.")
6466N/A+ if hostConfig.Memory > 0 && hostConfig.MemoryReservation > 0 && hostConfig.Memory < hostConfig.MemoryReservation {
6466N/A+ return warnings, fmt.Errorf("Minimum memory limit should be larger than memory reservation limit, see usage.")
6466N/A+ warnings = append(warnings, "Your kernel does not support kernel memory limit capabilities. Limitation discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support kernel memory limit capabilities. Limitation discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support CPU shares. Shares discarded.")
6466N/A+ if hostConfig.CPUShares < 0 {
6466N/A+ logrus.Warnf("Invalid CPUShares value. Must be positive. Discarding.")
6466N/A+ warnings = append(warnings, "Global zone default scheduling class not FSS. Discarding shares.")
6466N/A+ logrus.Warnf("Global zone default scheduling class not FSS. Discarding shares.")
6466N/A+ // Solaris NOTE: Linux does not do negative checking for CPUShares and Quota here. But it makes sense to.
6466N/A+ warnings = append(warnings, "Your kernel does not support CPU cfs period. Period discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support CPU cfs period. Period discarded.")
6466N/A+ if hostConfig.CPUQuota > 0 {
6466N/A+ warnings = append(warnings, "Quota will be applied on default period, not period specified.")
6466N/A+ logrus.Warnf("Quota will be applied on default period, not period specified.")
6466N/A+ warnings = append(warnings, "Your kernel does not support CPU cfs quota. Quota discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support CPU cfs quota. Quota discarded.")
6466N/A+ if hostConfig.CPUQuota < 0 {
6466N/A+ logrus.Warnf("Invalid CPUQuota value. Must be positive. Discarding.")
6466N/A+ logrus.Warnf("Your kernel does not support cpuset. Cpuset discarded.")
6466N/A+ hostConfig.CpusetCpus = ""
6466N/A+ hostConfig.CpusetMems = ""
6466N/A+ return warnings, fmt.Errorf("Requested CPUs are not available - requested %s, available: %s.", hostConfig.CpusetCpus, sysInfo.Cpus)
6466N/A+ return warnings, fmt.Errorf("Requested memory nodes are not available - requested %s, available: %s.", hostConfig.CpusetMems, sysInfo.Mems)
6466N/A+ warnings = append(warnings, "Your kernel does not support Block I/O weight. Weight discarded.")
6466N/A+ logrus.Warnf("Your kernel does not support Block I/O weight. Weight discarded.")
6466N/A+ *hostConfig.OomKillDisable = false
6466N/A+ logrus.Warnf("IPv4 forwarding is disabled. Networking will not work")
6466N/A+ // Solaris NOTE: We do not allow setting Linux specific options, so check and warn for all of them.
6466N/A+ warnings = append(warnings, "Adding or dropping kernel capabilities unsupported on Solaris.Discarding capabilities lists.")
6466N/A+ logrus.Warnf("Adding or dropping kernel capabilities unsupported on Solaris.Discarding capabilities lists.")
6466N/A+ hostConfig.CapAdd = nil
6466N/A+ hostConfig.CapDrop = nil
6466N/A+ if hostConfig.GroupAdd != nil {
6466N/A+ warnings = append(warnings, "Additional groups unsupported on Solaris.Discarding groups lists.")
6466N/A+ hostConfig.GroupAdd = nil
6466N/A+ if hostConfig.IpcMode != "" {
6466N/A+ warnings = append(warnings, "IPC namespace assignment unsupported on Solaris.Discarding IPC setting.")
6466N/A+ hostConfig.IpcMode = ""
6466N/A+ if hostConfig.PidMode != "" {
6466N/A+ warnings = append(warnings, "PID namespace setting unsupported on Solaris. Running container in host PID namespace.")
6466N/A+ logrus.Warnf("PID namespace setting unsupported on Solaris. Running container in host PID namespace.")
6466N/A+ hostConfig.PidMode = ""
6466N/A+ if hostConfig.Privileged {
6466N/A+ warnings = append(warnings, "Privileged mode unsupported on Solaris. Discarding privileged mode setting.")
6466N/A+ logrus.Warnf("Privileged mode unsupported on Solaris. Discarding privileged mode setting.")
6466N/A+ hostConfig.Privileged = false
6466N/A+ if hostConfig.UTSMode != "" {
6466N/A+ warnings = append(warnings, "UTS namespace assignment unsupported on Solaris.Discarding UTS setting.")
6466N/A+ hostConfig.UTSMode = ""
6466N/A+ if hostConfig.CgroupParent != "" {
6466N/A+ warnings = append(warnings, "Specifying Cgroup parent unsupported on Solaris. Discarding cgroup parent setting.")
6466N/A+ logrus.Warnf("Specifying Cgroup parent unsupported on Solaris. Discarding cgroup parent setting.")
6466N/A+ if hostConfig.Ulimits != nil {
6466N/A+ warnings = append(warnings, "Specifying ulimits unsupported on Solaris. Discarding ulimits setting.")
6466N/A+ logrus.Warnf("Specifying ulimits unsupported on Solaris. Discarding ulimits setting.")
6466N/A+ hostConfig.Ulimits = nil
6466N/A+ if id, err := C.getzoneid(); err != nil {
6466N/A+ fmt.Errorf("Exiting because the Docker daemon is not running in the global zone")
6466N/A+ v, err := kernel.GetKernelVersion()
6466N/A+ if kernel.CompareKernelVersion(*v, kernel.VersionInfo{Kernel: 5, Major: 12, Minor: 0}) < 0 {
6466N/A+ return fmt.Errorf("Your Solaris kernel version: %s doesn't support Docker. Please upgrade to 5.12.0", v.String())
6466N/A+// which is 90% of the kernel setting from /proc/sys/kernel/threads-max
6466N/A+func migrateIfDownlevel(driver graphdriver.Driver, root string) error {
6466N/A+ return config.bridgeConfig.Iface == disableNetworkBridge
6466N/A+func (daemon *Daemon) networkOptions(dconfig *Config) ([]nwconfig.Option, error) {
6466N/A+ options := []nwconfig.Option{}
6466N/A+ dn := runconfig.DefaultDaemonNetworkMode().NetworkName()
6466N/A+ options = append(options, nwconfig.OptionDefaultDriver(string(dd)))
6466N/A+ options = append(options, nwconfig.OptionDefaultNetwork(dn))
6466N/A+ return nil, fmt.Errorf("kv store daemon config must be of the form KV-PROVIDER://KV-URL")
6466N/A+ options = append(options, nwconfig.OptionKVProvider(kv[0]))
6466N/A+ options = append(options, nwconfig.OptionKVProviderURL(kv[1]))
6466N/A+ if len(dconfig.ClusterOpts) > 0 {
6466N/A+ if daemon.discoveryWatcher != nil {
6466N/A+ if dconfig.ClusterAdvertise != "" {
6466N/A+func (daemon *Daemon) initNetworkController(config *Config) (libnetwork.NetworkController, error) {
6466N/A+ netOptions, err := daemon.networkOptions(config)
6466N/A+ controller, err := libnetwork.New(netOptions...)
6466N/A+ return nil, fmt.Errorf("error obtaining controller instance: %v", err)
6466N/A+ if _, err := controller.NewNetwork("null", "none", libnetwork.NetworkOptionPersist(false)); err != nil {
6466N/A+ return nil, fmt.Errorf("Error creating default \"null\" network: %v", err)
6466N/A+ if !config.DisableBridge {
6466N/A+func initBridgeDriver(controller libnetwork.NetworkController, config *Config) error {
6466N/A+ if n, err := controller.NetworkByName("bridge"); err == nil {
6466N/A+ return fmt.Errorf("could not delete the default bridge network: %v", err)
6466N/A+ bridgeName := bridge.DefaultBridgeName
6466N/A+ if config.bridgeConfig.Iface != "" {
6466N/A+ bridgeName = config.bridgeConfig.Iface
6466N/A+ bridge.BridgeName: bridgeName,
6466N/A+ if config.bridgeConfig.DefaultIP != nil {
6466N/A+ ipamV4Conf *libnetwork.IpamConf
6466N/A+ ipamV6Conf *libnetwork.IpamConf
6466N/A+ ipamV4Conf = &libnetwork.IpamConf{AuxAddresses: make(map[string]string)}
6466N/A+ nw, nw6List, err := ipamutils.ElectInterfaceAddresses(bridgeName)
6466N/A+ if hip.IsGlobalUnicast() {
6466N/A+ if config.bridgeConfig.IP != "" {
6466N/A+ logrus.Infof("Default bridge (%s) is assigned with an IP address %s. Daemon option --bip can be used to set a preferred IP address", bridgeName, ipamV4Conf.PreferredPool)
6466N/A+ if config.bridgeConfig.FixedCIDR != "" {
6466N/A+ if config.bridgeConfig.DefaultGatewayIPv4 != nil {
6466N/A+ ipamV4Conf.AuxAddresses["DefaultGatewayIPv4"] = config.bridgeConfig.DefaultGatewayIPv4.String()
6466N/A+ if config.bridgeConfig.FixedCIDRv6 != "" {
6466N/A+ ones, _ := fCIDRv6.Mask.Size()
6466N/A+ ipamV6Conf = &libnetwork.IpamConf{AuxAddresses: make(map[string]string)}
6466N/A+ if config.bridgeConfig.DefaultGatewayIPv6 != nil {
6466N/A+ ipamV6Conf = &libnetwork.IpamConf{AuxAddresses: make(map[string]string)}
6466N/A+ ipamV6Conf.AuxAddresses["DefaultGatewayIPv6"] = config.bridgeConfig.DefaultGatewayIPv6.String()
6466N/A+ v4Conf := []*libnetwork.IpamConf{ipamV4Conf}
6466N/A+ v6Conf := []*libnetwork.IpamConf{}
6466N/A+ _, err = controller.NewNetwork("bridge", "bridge",
6466N/A+ netlabel.GenericData: netOption,
6466N/A+ libnetwork.NetworkOptionIpam("default", "", v4Conf, v6Conf, nil),
6466N/A+ libnetwork.NetworkOptionDeferIPv6Alloc(deferIPv6Alloc))
6466N/A+ return fmt.Errorf("Error creating default \"bridge\" network: %v", err)
6466N/A+func (daemon *Daemon) registerLinks(container *container.Container, hostConfig *containertypes.HostConfig) error {
7305N/A+ if hostConfig == nil || hostConfig.NetworkMode.IsUserDefined() {
7305N/A+ for _, l := range hostConfig.Links {
7305N/A+ name, alias, err := runconfigopts.ParseLink(l)
7305N/A+ child, err := daemon.GetContainer(name)
7305N/A+ //An error from daemon.GetContainer() means this name could not be found
7305N/A+ return fmt.Errorf("Could not get container for %s", name)
7305N/A+ child, err = daemon.GetContainer(parts[1])
7305N/A+ return fmt.Errorf("Could not get container for %s", parts[1])
7305N/A+ if err := daemon.registerLink(container, child, alias); err != nil {
7305N/A+ return container.WriteHostConfig()
6466N/A+func (daemon *Daemon) conditionalMountOnStart(container *container.Container) error {
6466N/A+ return daemon.Mount(container)
6466N/A+func (daemon *Daemon) conditionalUnmountOnCleanup(container *container.Container) {
6466N/A+ daemon.Unmount(container)
6466N/A+func driverOptions(config *Config) []nwconfig.Option {
6466N/A+ return []nwconfig.Option{}
6466N/Aindex 5b7d4cf..e97298c 100644
6466N/Aindex 987528f..cb1acf6 100644
6466N/Aindex fef1bd7..cbe4e91 100644
6466N/A+func setPlatformSpecificExecProcessConfig(config *types.ExecConfig, container *container.Container, pc *execdriver.ProcessConfig) {
6466N/A+ user := config.User
6466N/A+ user = container.Config.User
6466N/A+ Console string `json:"-"` // dev/console path
6466N/A+// Command wraps an os/exec.Cmd to add more metadata
6466N/Aindex 3ed3c81..fc4873d 100644
6466N/Adiff --git a/daemon/execdriver/execdrivers/execdrivers_solaris.go b/daemon/execdriver/execdrivers/execdrivers_solaris.go
6466N/A+func NewDriver(options []string, root, libPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
6466N/A+ return zones.NewDriver(root, options)
7267N/Aindex 0000000..db48175
6466N/A+#include <sys/types.h>
6466N/A+#include <sys/stat.h>
6466N/A+#include <sys/ctfs.h>
6466N/A+#include <sys/contract/process.h>
6466N/A+#include <libcontract.h>
6466N/A+ ctfd = open64(CTFS_ROOT "/process/template", O_RDWR | O_CLOEXEC);
6466N/A+ RUNZ = "/usr/lib/brand/solaris-oci/runz"
6466N/A+ EXEC_PATH = "/system/volatile"
6466N/A+ LX_DOCKER_INIT_PATH = "/usr/lib/brand/lx/lx_docker_init"
7171N/A+ SVCCFG = "/usr/sbin/svccfg"
6466N/A+// We don't yet have libcontainer.Factory support, so just whack it together here
6466N/A+ command *execdriver.Command
7068N/A+ if cttmpl, err = C.ct_pr_tmpl(); cttmpl == -1 {
7068N/A+ if errn := C.ct_abandon_latest(); errn != 0 {
7068N/A+ if errn := C.ct_clear(cttmpl); errn != 0 {
6466N/A+ if err := os.MkdirAll(root, 0700); err != nil {
6466N/A+ parts := strings.SplitN(pair, "=", 2)
6466N/A+func (d *Driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes, hooks execdriver.Hooks) (int, error) {
6466N/A+ args := []string{processConfig.Entrypoint}
6466N/A+ args = append(args, processConfig.Arguments...)
6466N/A+ hostname := getEnv("HOSTNAME", c.ProcessConfig.Env)
6466N/A+ if c.ProcessConfig.User != "" {
6466N/A+ userID, err = strconv.Atoi(ids[0])
7267N/A+ logrus.Error("Only uid[:gid] is supported")
6466N/A+ groupID, err = strconv.Atoi(ids[1])
7267N/A+ logrus.Error("Only uid[:gid] is supported")
6466N/A+ env := processConfig.Env
6466N/A+ env = c.ProcessConfig.Env
6466N/A+ Cwd: c.WorkingDir,
6466N/A+ Terminal: processConfig.Tty,
6466N/A+ fileJson, _ := json.Marshal(processconfig)
6466N/A+ if err := ioutil.WriteFile(ProcessPath, fileJson, 0644); err != nil {
6466N/A+ if pipes.Stdin != nil {
6466N/A+ var term execdriver.Terminal
6466N/A+ if processConfig.Tty {
6466N/A+ term, err = execdriver.NewStdConsole(processConfig, pipes)
6466N/A+ processConfig.Terminal = term
6466N/A+ if hooks.Start != nil {
6466N/A+ hooks.Start(processConfig, DUMMY_PID, chOOM)
6466N/A+ fmt.Printf("Calling \"runz stop\" from exec\n")
6466N/A+func setupMounts(mounts []execdriver.Mount, rootfs string) error {
6466N/A+ if !os.IsNotExist(err) {
6466N/A+ cmd := exec.Command("/usr/sbin/mount", "-F", "lofs", m.Source, filepath.Join(rootfs, m.Destination))
6466N/A+ errBuf := new(bytes.Buffer)
6466N/A+ cmd.Stderr = errBuf
6466N/A+ return fmt.Errorf("Failed to mount: %s", errBuf)
6466N/A+func destroyMounts(mounts []execdriver.Mount, rootfs string) error {
6466N/A+ return strconv.FormatFloat(val, 'f', 2, 64)
6466N/A+ return strconv.FormatInt(val, 10)
6466N/A+func (d *Driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, hooks execdriver.Hooks) (execdriver.ExitStatus, error) {
6466N/A+ args := []string{c.ProcessConfig.Entrypoint}
6466N/A+ args = append(args, c.ProcessConfig.Arguments...)
6466N/A+ hostname := getEnv("HOSTNAME", c.ProcessConfig.Env)
6466N/A+ fmt.Printf("The hostname of the container is: %+v\n", hostname)
6466N/A+ fmt.Printf("lx init failed\n")
6466N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
6466N/A+ if c.ProcessConfig.User != "" {
6466N/A+ userID, err = strconv.Atoi(ids[0])
7267N/A+ logrus.Error("Only uid[:gid] is supported")
7267N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
6466N/A+ groupID, err = strconv.Atoi(ids[1])
7267N/A+ logrus.Error("Only uid[:gid] is supported")
7267N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
6466N/A+ logrus.Infof("OCI Configuration: [%s]", ConfigPath)
6466N/A+ if c.Network.Interface.Bridge != "" {
6466N/A+ lowerlink = c.Network.Interface.Bridge
6466N/A+ Allowedaddr: c.Network.Interface.IPAddress,
6466N/A+ Defrouter: c.Network.Interface.Defrouter,
6466N/A+ Macaddress: c.Network.Interface.MacAddress,
6466N/A+ cont_milestone = "svc:/milestone/container:default"
6466N/A+ if c.Resources.CPUQuota > 0 {
6466N/A+ * c.Resources.CPUQuota = 50000 => 50% of cpu
6466N/A+ ncpus = (float64(c.Resources.CPUQuota) / 100000)
6466N/A+ Physical: setStringVal(c.Resources.Memory),
6466N/A+ Swap: setStringVal(c.Resources.MemorySwap),
6466N/A+ CpuShare: setStringVal(c.Resources.CPUShares),
6466N/A+ LimitPriv: c.LimitPriv,
6466N/A+ Cwd: c.WorkingDir,
6466N/A+ Env: c.ProcessConfig.Env,
6466N/A+ Terminal: c.ProcessConfig.Tty,
6466N/A+ Readonly: c.ReadonlyRootfs,
6466N/A+ fileJson, _ := json.Marshal(runzconfig)
6466N/A+ if err = ioutil.WriteFile(ConfigPath, fileJson, 0644); err != nil {
6466N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
7171N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
7171N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
7252N/A+ cmd := exec.Command(SVCCFG, "-s", "svc:/network/dns/client:default", "listprop", "general/enabled")
7252N/A+ outbufgen := new(bytes.Buffer)
7252N/A+ cmd.Stdout = outbufgen
7252N/A+ logrus.Errorf("Error listing property: %s", err)
7252N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
7252N/A+ cmd = exec.Command(SVCCFG, "-s", "svc:/network/dns/client:default", "listprop", "general_ovr/enabled")
7252N/A+ outbufgenovr := new(bytes.Buffer)
7252N/A+ cmd.Stdout = outbufgenovr
7252N/A+ logrus.Errorf("Error listing property: %s", err)
7252N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
7252N/A+ if strings.Contains(outbufgen.String(), "false") && strings.Contains(outbufgenovr.String(), "true") {
7252N/A+ logrus.Errorf("Error opening file: %v", err)
7252N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
7252N/A+ scanner := bufio.NewScanner(f)
7252N/A+ logrus.Errorf("Error creating file: %v", err)
7252N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
7252N/A+ wr := bufio.NewWriter(f)
7252N/A+ for scanner.Scan() {
7252N/A+ line := scanner.Text()
7252N/A+ if (strings.Contains(line, "<instance name=\"default\"") || strings.Contains(line, "<create_default_instance")) && FoundDnsClient == true {
7252N/A+ if strings.Contains(line, "enabled") {
7252N/A+ src := bytes.Replace([]byte(line), []byte("false"), []byte("true"), -1)
7252N/A+ wr.WriteString(line)
7171N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
6466N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
6466N/A+ if pipes.Stdin != nil {
6466N/A+ var term execdriver.Terminal
6466N/A+ if c.ProcessConfig.Tty {
6466N/A+ c.ProcessConfig.Terminal = term
6466N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
6466N/A+ if hooks.Start != nil {
6466N/A+ fmt.Printf("Calling \"runz stop\" from run\n")
6466N/A+ if msg, ok := err.(*exec.ExitError); ok { // there is error code
6466N/A+ return execdriver.ExitStatus{ExitCode: status}, err
6466N/A+ return execdriver.ExitStatus{ExitCode: -1}, err
6466N/A+ return execdriver.ExitStatus{ExitCode: 0}, nil
6466N/A+func (d *Driver) Kill(c *execdriver.Command, sig int) error {
6466N/A+ outbuf := new(bytes.Buffer)
6466N/A+ errbuf := new(bytes.Buffer)
6466N/A+ cmd.Stdout = outbuf
6466N/A+ cmd.Stderr = errbuf
6466N/A+ logrus.Errorf("%v: failed to wait kill: %+v %+v", c.Name, outbuf.String(), errbuf.String())
6466N/A+func (d *Driver) Pause(c *execdriver.Command) error {
6466N/A+ return errors.New("Pause is not supported in zones execdriver")
6466N/A+func (d *Driver) Unpause(c *execdriver.Command) error {
6466N/A+ return errors.New("Unpause is not supported in zones execdriver")
6466N/A+func (d *Driver) Terminate(c *execdriver.Command) error {
6466N/A+ return errors.New("Terminate is not supported in zones execdriver")
6466N/A+func (d *Driver) Info(id string) execdriver.Info {
6466N/A+ return fmt.Sprintf("%s-%s", DriverName, Version)
6466N/A+ return nil, errors.New("GetPidsForContainer is not supported in zones execdriver")
6466N/A+func (d *Driver) Stats(id string) (*execdriver.ResourceStats, error) {
7068N/A+ return nil, errors.New("Stats is not supported in zones execdriver")
6466N/A+func (d *Driver) Update(c *execdriver.Command) error {
6466N/A+ return errors.New("Update is not supported in zones execdriver")
6466N/A+ console libcontainer.Console
6466N/Adiff --git a/daemon/execdriver/zones/driver_unsupported.go b/daemon/execdriver/zones/driver_unsupported.go
6466N/A+func NewDriver(root, initPath string) (execdriver.Driver, error) {
6466N/A+ return nil, fmt.Errorf("zones driver only supported on Solaris")
6466N/Adiff --git a/daemon/execdriver/zones/driver_unsupported_nocgo.go b/daemon/execdriver/zones/driver_unsupported_nocgo.go
6466N/A+func NewDriver(root, initPath string) (execdriver.Driver, error) {
6466N/A+ return nil, fmt.Errorf("zones driver requires cgo support")
6466N/Aindex 0000000..be4eb52
6466N/Adiff --git a/daemon/graphdriver/driver_unsupported.go b/daemon/graphdriver/driver_unsupported.go
6466N/Adiff --git a/daemon/graphdriver/graphtest/graphtest_unix.go b/daemon/graphdriver/graphtest/graphtest_unix.go
6466N/Aindex 534f2e5..c3e2b35 100644
6466N/Adiff --git a/daemon/graphdriver/register/register_zfs.go b/daemon/graphdriver/register/register_zfs.go
6466N/A+ elapsed := time.Since(start)
6466N/A+ fmt.Printf("%s took %s time\n", name, elapsed)
6466N/A // It takes base mount path and a array of options which are represented as key value pairs.
6466N/A // Each option is in the for key=value. 'zfs.fsname' is expected to be a valid key in the options.
6466N/A func Init(base string, opt []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
6466N/A if _, err := exec.LookPath("zfs"); err != nil {
6466N/A-// Status returns information about the ZFS filesystem. It returns a two dimensional array of information
6466N/A- pool, err := zfs.GetZpool(parts[0])
6466N/A- poolHealth = pool.Health
6466N/A- poolName = fmt.Sprintf("error while getting pool information %v", err)
6466N/A- if d.dataset.Quota != 0 {
6466N/A- {"Parent Dataset", d.dataset.Name},
6466N/A- {"Compression", d.dataset.Compression},
6466N/A // GetMetadata returns image/container metadata related to graph driver
6466N/A- _, err = snapshot.Clone(name, map[string]string{"mountpoint": "legacy"})
6466N/A+ _, err = snapshot.Clone(name, mountOptions)
6466N/A d.filesystemsCache[name] = true
6466N/A@@ -267,8 +239,7 @@ func (d *Driver) Create(id string, parent string, mountLabel string) error {
6466N/A- fs, err := zfs.CreateFilesystem(name, mountoptions)
6466N/A+ fs, err := zfs.CreateFilesystem(name, mountOptions)
6466N/A var buf syscall.Statfs_t
6466N/A if err := syscall.Statfs(rootdir, &buf); err != nil {
6466N/A+// Status returns information about the ZFS filesystem. It returns a two dimensional array of information
6466N/A+ pool, err := zfs.GetZpool(parts[0])
6466N/A+ poolHealth = pool.Health
6466N/A+ poolName = fmt.Sprintf("error while getting pool information %v", err)
6466N/A+ if d.dataset.Quota != 0 {
6466N/A+ {"Parent Dataset", d.dataset.Name},
6466N/A+ {"Compression", d.dataset.Compression},
6466N/A var buf syscall.Statfs_t
6466N/A if err := syscall.Statfs(rootdir, &buf); err != nil {
6466N/A+// Status returns information about the ZFS filesystem. It returns a two dimensional array of information
6466N/A+ pool, err := zfs.GetZpool(parts[0])
6466N/A+ poolHealth = pool.Health
6466N/A+ poolName = fmt.Sprintf("error while getting pool information %v", err)
6466N/A+ if d.dataset.Quota != 0 {
6466N/A+ {"Parent Dataset", d.dataset.Name},
6466N/A+ {"Compression", d.dataset.Compression},
6466N/Aindex 0000000..a9a174b
6466N/A+#include <sys/statvfs.h>
6466N/A+ buf := C.getstatfs(cs)
6466N/A+ // on Solaris buf.f_basetype contains ['z', 'f', 's', 0 ... ]
6466N/A+ if (buf.f_basetype[0] != 122) || (buf.f_basetype[1] != 102) || (buf.f_basetype[2] != 115) ||
6466N/A+ (buf.f_basetype[3] != 0) {
6466N/A+ log.Debugf("[zfs] no zfs dataset found for rootdir '%s'", rootdir)
6466N/A+ return graphdriver.ErrPrerequisites
6466N/A+ suffix := strings.SplitN(id, "-", 2)
6466N/A+ return filepath.Join(id[:maxlen]+"-"+suffix[1], "rootfs", "root")
6466N/A+ return filepath.Join(id[:maxlen], "rootfs", "root")
6466N/A+// Status returns information about the ZFS filesystem. It returns a two dimensional array of information
6466N/A+ pool, err := zfs.GetZpool(parts[0])
6466N/A+ poolHealth = pool.Health
6466N/A+ poolName = fmt.Sprintf("error while getting pool information %v", err)
6466N/A+ if d.dataset.Quota != "" {
6466N/A+ quota = d.dataset.Quota
6466N/A+ {"Parent Dataset", d.dataset.Name},
6466N/A+ {"Space Used By Parent", d.dataset.Used},
6466N/A+ {"Space Available", d.dataset.Avail},
6466N/A+ {"Compression", d.dataset.Compression},
6466N/Adiff --git a/daemon/graphdriver/zfs/zfs_unsupported.go b/daemon/graphdriver/zfs/zfs_unsupported.go
6466N/Aindex 643b169..ce8daad 100644
7068N/A@@ -134,11 +134,9 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
7068N/A func (daemon *Daemon) SystemVersion() types.Version {
7068N/A v := types.Version{
7068N/A Version: dockerversion.Version,
7068N/A- GitCommit: dockerversion.GitCommit,
7068N/A GoVersion: runtime.Version(),
7068N/A Os: runtime.GOOS,
7068N/A Arch: runtime.GOARCH,
7068N/A- BuildTime: dockerversion.BuildTime,
7068N/A Experimental: utils.ExperimentalBuild(),
6466N/Aindex 0000000..e42a61d
6466N/A+func setPlatformSpecificContainerFields(container *container.Container, contJSONBase *types.ContainerJSONBase) *types.ContainerJSONBase {
6466N/A+ for _, m := range container.MountPoints {
6466N/A+ mountPoints = append(mountPoints, types.MountPoint{
6466N/A+ Destination: m.Destination,
6466N/A+func (daemon *Daemon) containerInspectPre120(name string) (*types.ContainerJSON, error) {
6466N/A+ return daemon.containerInspectCurrent(name, false)
6466N/Aindex b9321f3..d241711 100644
6466N/A@@ -154,6 +155,9 @@ func getIpamConfig(data []network.IPAMConfig) ([]*libnetwork.IpamConf, []*libnet
6466N/A func (daemon *Daemon) ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error {
6466N/A+ if runtime.GOOS == "solaris" {
6466N/A+ return errors.New("docker network connect is unsupported on Solaris platform\n")
6466N/A container, err := daemon.GetContainer(containerName)
6466N/A@@ -164,6 +168,9 @@ func (daemon *Daemon) ConnectContainerToNetwork(containerName, networkName strin
6466N/A func (daemon *Daemon) DisconnectContainerFromNetwork(containerName string, network libnetwork.Network, force bool) error {
6466N/A+ if runtime.GOOS == "solaris" {
6466N/A+ return errors.New("docker network disconnect is unsupported on Solaris platform\n")
6466N/A container, err := daemon.GetContainer(containerName)
6466N/A+ containertypes "github.com/docker/engine-api/types/container"
6466N/A+func mergeLxcConfIntoOptions(hostConfig *containertypes.HostConfig) ([]string, error) {
6730N/A containertypes "github.com/docker/engine-api/types/container"
6730N/A+const SVCCFG = "/usr/sbin/svccfg"
6730N/A func (daemon *Daemon) ContainerStart(name string, hostConfig *containertypes.HostConfig) error {
6730N/A container, err := daemon.GetContainer(name)
7171N/A@@ -142,6 +146,18 @@ func (daemon *Daemon) containerStart(container *container.Container) (err error)
6466N/A mounts = append(mounts, container.TmpfsMounts()...)
6466N/A container.Command.Mounts = mounts
6466N/A+ if runtime.GOOS == "solaris" {
6466N/A+ return errors.New("Platform on which parent image was created is not Solaris\n")
6466N/A if err := daemon.waitForStart(container); err != nil {
7068N/A+#include <zonestat.h>
7068N/A+#include <sys/param.h>
7068N/A+#define KSTAT2_IO_URI "kstat:/misc/unix/vopstats_zfs/%d"
7068N/A+ zio->nread = val->data.integer;
7068N/A+ zio->read_bytes = val->data.integer;
7068N/A+ zio->nwrite = val->data.integer;
7068N/A+ zio->write_bytes = val->data.integer;
7068N/A+ zns->ipackets = val->data.integer;
7068N/A+ zns->ibytes = val->data.integer;
7068N/A+ zns->ierrors = val->data.integer;
7068N/A+ zns->idrops = val->data.integer;
7068N/A+ zns->opackets = val->data.integer;
7068N/A+ zns->obytes = val->data.integer;
7068N/A+ zns->oerrors = val->data.integer;
7068N/A+ zns->odrops = val->data.integer;
7068N/A+func getZoneName(z C.zs_zone_t) string {
7068N/A+ getZoneStats(z C.zs_zone_t, zoneid uint64, container *container.Container) (*execdriver.ResourceStats, error)
7068N/A+ publisher *pubsub.Publisher
6466N/A+func (daemon *Daemon) newStatsCollector(interval time.Duration) *statsCollector {
7068N/A+ publishers: make(map[*container.Container]*zonePublisher),
7068N/A+ bufReader: bufio.NewReaderSize(nil, 128),
7068N/A+ interval time.Duration
7068N/A+ publishers map[*container.Container]*zonePublisher
7068N/A+ bufReader *bufio.Reader
6466N/A+func (s *statsCollector) collect(c *container.Container) chan interface{} {
6466N/A+ defer s.m.Unlock()
7068N/A+ zpub, exists := s.publishers[c]
7068N/A+ s.publishers[c] = zpub
7068N/A+ return zpub.publisher.Subscribe()
6466N/A+func (s *statsCollector) stopCollection(c *container.Container) {
6466N/A+ defer s.m.Unlock()
7068N/A+ if zpub, exists := s.publishers[c]; exists {
6466N/A+ delete(s.publishers, c)
6466N/A+// unsubscribe removes a specific subscriber from receiving updates for a container's stats.
6466N/A+func (s *statsCollector) unsubscribe(c *container.Container, ch chan interface{}) {
6466N/A+ defer s.m.Unlock()
7068N/A+ zpub, exists := s.publishers[c]
7068N/A+ if zpub.publisher.Len() == 0 {
6466N/A+ delete(s.publishers, c)
6466N/A+ container *container.Container
7068N/A+ memoryInfo, err := system.ReadMemInfo()
7068N/A+ machineMemory := memoryInfo.MemTotal
7068N/A+ usage_last, err := C.get_usage(zsctl)
7068N/A+ logrus.Error("Failed to get usage: ", err)
7068N/A+ C.zs_close(zsctl)
7068N/A+ var usage_diff C.zs_usage_t
7068N/A+ for container, zpub := range s.publishers {
7068N/A+ usage, err := C.get_usage(zsctl)
7068N/A+ usage_diff = C.zs_usage_diff(usage_last, usage)
7068N/A+ logrus.Error("Failed to get usage: ", err)
7068N/A+ systemUsage := uint64(C.getSystemCPUUsage(usage_diff))
7068N/A+ var z C.zs_zone_t
7068N/A+ zoneid := pair.zpub.zoneid
7068N/A+ pair.zpub.zoneid = uint64(zid)
7068N/A+ zoneid = pair.zpub.zoneid
6466N/A+ if err != execdriver.ErrNotRunning {
7068N/A+ if stats.MemoryLimit == 0 {
7068N/A+ stats.MemoryLimit = machineMemory
6466N/A+ stats.SystemUsage = systemUsage
7068N/A+ pair.zpub.publisher.Publish(stats)
7068N/A+ C.zs_usage_free(usage_last)
7068N/A+ C.zs_usage_free(usage_diff)
7068N/A+ C.zs_close(zsctl)
7068N/A+func getIOStats(zoneid uint64) (*zones.BlkioStats, error) {
7068N/A+ ioBytes := []zones.BlkioStatEntry{
7068N/A+ Value: uint64(iostats.write_bytes),
7068N/A+ Value: uint64(iostats.read_bytes),
7068N/A+ ioCount := []zones.BlkioStatEntry{
7068N/A+ Value: uint64(iostats.nwrite),
7068N/A+ Value: uint64(iostats.nread),
7068N/A+ C.io_stats_free(iostats)
7068N/A+ ioStats := zones.BlkioStats{
7068N/A+func getNetStats(zoneid uint64) ([]*libcontainer.NetworkInterface, error) {
7068N/A+ m := make(map[string]*types.InterfaceStatistics)
7068N/A+ s := types.InterfaceStatistics{}
7068N/A+ C.net_stats_free(ns)
7068N/A+ var list []*libcontainer.NetworkInterface
7068N/A+ cstats := &libcontainer.Stats{}
7068N/A+ zstats := zones.Stats{}
7068N/A+ cpuUsage := uint64(C.getCpuUsage(z))
7068N/A+ zstats.CpuStats.CpuUsage.PercpuUsage = []uint64{cpuUsage}
7068N/A+ zstats.CpuStats.CpuUsage.TotalUsage = uint64(cpuUsage)
7068N/A+ zstats.CpuStats.CpuUsage.UsageInKernelmode = uint64(cpuUsage)
7068N/A+ zstats.CpuStats.CpuUsage.UsageInUsermode = uint64(cpuUsage)
7068N/A+ zstats.MemoryStats.Usage.Usage = memUsage
7068N/A+ zstats.BlkioStats = *iostats
7068N/A+ cstats.Stats = &zstats
7068N/A+func (daemon *Daemon) getZoneStats(z C.zs_zone_t, zoneid uint64, container *container.Container) (*execdriver.ResourceStats, error) {
7068N/A+ if memoryLimit == C.ZS_LIMIT_NONE {
7068N/A+ zstats.Interfaces = netstats
7068N/A+ stats := &execdriver.ResourceStats{
6466N/Aindex 2fd368c..ec408c6 100644
7068N/Aindex 0000000..a1230c6
6466N/A+// convertStatsToAPITypes converts the libcontainer.Stats to the api specific
6466N/A+ s := &types.StatsJSON{}
6466N/A+ if ls.Interfaces != nil {
6466N/A+ for _, iface := range ls.Interfaces {
6466N/A+ RxBytes: iface.RxBytes,
6466N/A+ RxPackets: iface.RxPackets,
6466N/A+ RxErrors: iface.RxErrors,
6466N/A+ RxDropped: iface.RxDropped,
6466N/A+ TxBytes: iface.TxBytes,
6466N/A+ TxPackets: iface.TxPackets,
6466N/A+ TxErrors: iface.TxErrors,
6466N/A+ TxDropped: iface.TxDropped,
7068N/A+ IoServiceBytesRecursive: copyBlkioEntry(cs.BlkioStats.IoServiceBytesRecursive),
7068N/A+ IoServicedRecursive: copyBlkioEntry(cs.BlkioStats.IoServicedRecursive),
7068N/A+ IoQueuedRecursive: copyBlkioEntry(cs.BlkioStats.IoQueuedRecursive),
7068N/A+ IoServiceTimeRecursive: copyBlkioEntry(cs.BlkioStats.IoServiceTimeRecursive),
7068N/A+ IoWaitTimeRecursive: copyBlkioEntry(cs.BlkioStats.IoWaitTimeRecursive),
7068N/A+ IoMergedRecursive: copyBlkioEntry(cs.BlkioStats.IoMergedRecursive),
7068N/A+ IoTimeRecursive: copyBlkioEntry(cs.BlkioStats.IoTimeRecursive),
7068N/A+ SectorsRecursive: copyBlkioEntry(cs.BlkioStats.SectorsRecursive),
7068N/A+ cpu := cs.CpuStats
7068N/A+ CPUUsage: types.CPUUsage{
7068N/A+ TotalUsage: cpu.CpuUsage.TotalUsage,
7068N/A+ PercpuUsage: cpu.CpuUsage.PercpuUsage,
7068N/A+ UsageInKernelmode: cpu.CpuUsage.UsageInKernelmode,
7068N/A+ UsageInUsermode: cpu.CpuUsage.UsageInUsermode,
7068N/A+ ThrottlingData: types.ThrottlingData{
7068N/A+ Periods: cpu.ThrottlingData.Periods,
7068N/A+ ThrottledPeriods: cpu.ThrottlingData.ThrottledPeriods,
7068N/A+ ThrottledTime: cpu.ThrottlingData.ThrottledTime,
7068N/A+ mem := cs.MemoryStats
7068N/A+ Usage: mem.Usage.Usage,
7068N/A+ MaxUsage: mem.Usage.MaxUsage,
7068N/A+ Failcnt: mem.Usage.Failcnt,
6466N/A+ out := make([]types.BlkioStatEntry, len(entries))
6466N/A+ out[i] = types.BlkioStatEntry{
6466N/Aindex 0000000..ee22de9
6466N/A+ apiserver "github.com/docker/docker/api/server"
6466N/A+//const defaultDaemonConfigFile = "/etc/docker/daemon.json"
6466N/A+func setPlatformServerConfig(serverConfig *apiserver.Config, daemonCfg *daemon.Config) *apiserver.Config {
6466N/A+ if fileInfo, err := system.Stat(f); err == nil && fileInfo != nil {
6466N/A+ syscall.Umask(desiredUmask)
6466N/A+ if umask := syscall.Umask(desiredUmask); umask != desiredUmask {
6466N/A+ return fmt.Errorf("failed to set umask: expected %#o, got %#o", desiredUmask, umask)
6466N/A+ return "/etc/docker"
6466N/A+func setupConfigReloadTrap(configFile string, flags *mflag.FlagSet, reload func(*daemon.Config)) {
6466N/Aindex e3be72b..b2fa5ef 100755
6466N/A find='/usr/bin/find'
6466N/A- $find "$dir" -maxdepth 1 -not -type d -not -name 'LICENSE*' -not -name 'COPYING*' -exec rm -v -f '{}' ';'
6466N/A+ $find "$dir" -maxdepth 1 -not -type d -not -name 'LICENSE*' -not -name 'COPYING*' -exec grm -v -f '{}' ';'
6466N/A local target="vendor/src/$pkg"
6466N/A+ export GOPATH="${GOPATH}:/usr/lib/gocode/1.5"
6466N/A TESTFLAGS+=" -test.timeout=${TIMEOUT}"
6466N/A+ EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC_DOCKER -Wl,--unresolved-symbols=ignore-in-object-files"
6466N/A--- a/hack/make/.detect-daemon-osarch
6466N/A+++ b/hack/make/.detect-daemon-osarch
6466N/A+# Retrieve the architecture used in contrib/builder/(deb|rpm)/$PACKAGE_ARCH/
6466N/Aindex c159fa8..f7d200e 100644
6466N/A--- a/hack/make/.ensure-httpserver
6466N/A+++ b/hack/make/.ensure-httpserver
6466N/A@@ -8,7 +8,7 @@ dir="$DEST/httpserver"
6466N/A- GOOS=${DOCKER_ENGINE_GOOS:="linux"} GOARCH=${DOCKER_ENGINE_GOARCH:="amd64"} go build -o httpserver github.com/docker/docker/contrib/httpserver
6466N/A+ GOOS=${DOCKER_ENGINE_GOOS:="solaris"} GOARCH=${DOCKER_ENGINE_GOARCH:="amd64"} go build -o httpserver github.com/docker/docker/contrib/httpserver
6466N/A cp ../../../../contrib/httpserver/Dockerfile .
6466N/Aindex 9732486..dc557fe 100644
6466N/A--- a/hack/make/.integration-daemon-setup
6466N/A+++ b/hack/make/.integration-daemon-setup
6466N/A--- a/hack/make/.integration-daemon-start
6466N/A+++ b/hack/make/.integration-daemon-start
6466N/A # intentionally open a couple bogus file descriptors to help test that they get scrubbed in containers
6466N/A+export HTTP_PROXY="http://www-proxy.us.oracle.com:80"
6466N/A+export HTTPS_PROXY="https://www-proxy.us.oracle.com:80"
6466N/A export DOCKER_HOST="unix://$(cd "$DEST" && pwd)/docker.sock" # "pwd" tricks to make sure $DEST is an absolute path, not a relative one
6466N/A --pidfile "$DEST/docker.pid" \
6466N/A &> "$DEST/docker.log"
6466N/Adiff --git a/integration-cli/docker_api_build_test.go b/integration-cli/docker_api_build_test.go
6466N/Aindex 49de71c9..e2679bb 100644
6466N/Adiff --git a/integration-cli/docker_api_events_test.go b/integration-cli/docker_api_events_test.go
6466N/Aindex 5d6e817..f584663 100644
6466N/A ts := strconv.FormatInt(since, 10)
6466N/A containerID := strings.TrimSpace(out)
6466N/Adiff --git a/integration-cli/docker_api_exec_test.go b/integration-cli/docker_api_exec_test.go
6466N/A resp, body, err := sockRequestRaw("POST", fmt.Sprintf("/v1.20/exec/%s/start", id), strings.NewReader(`{"Detach": true}`), "text/plain")
6466N/A startExec(c, execID, http.StatusOK)
6466N/Adiff --git a/integration-cli/docker_api_inspect_test.go b/integration-cli/docker_api_inspect_test.go
6466N/Aindex 6e3753e..b977cb4 100644
6466N/A cleanedContainerID := strings.TrimSpace(out)
6466N/A@@ -69,7 +69,7 @@ func (s *DockerSuite) TestInspectApiContainerVolumeDriverLegacy(c *check.C) {
6466N/A cleanedContainerID := strings.TrimSpace(out)
6466N/A- endpoint := "/images/busybox/json"
6466N/A+ endpoint := "/images/solaris/json"
6466N/A var imageJSON types.ImageInspect
6466N/A err = json.Unmarshal(body, &imageJSON)
6466N/Adiff --git a/integration-cli/docker_api_volumes_test.go b/integration-cli/docker_api_volumes_test.go
6466N/Aindex eab1909..dbd2cda 100644
6466N/Adiff --git a/integration-cli/docker_cli_attach_unix_test.go b/integration-cli/docker_cli_attach_unix_test.go
6466N/Adiff --git a/integration-cli/docker_cli_authz_unix_test.go b/integration-cli/docker_cli_authz_unix_test.go
6466N/Adiff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go
6466N/A cmd := exec.Command(dockerBinary, "build", "-t", "tag1", "-t", "tag2:v2",
6466N/Adiff --git a/integration-cli/docker_cli_build_unix_test.go b/integration-cli/docker_cli_build_unix_test.go
6466N/Aindex ea8b32a..d670823 100644
6466N/Adiff --git a/integration-cli/docker_cli_create_test.go b/integration-cli/docker_cli_create_test.go
6466N/Aindex 633313e..a424833 100644
6466N/A@@ -409,7 +409,7 @@ func (s *DockerTrustSuite) TestTrustedCreateFromBadTrustServer(c *check.C) {
6466N/A res, err := inspectFieldJSON(name, "Config.StopSignal")
6466N/Adiff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go
6466N/A // TestDaemonIPv6Enabled checks that when the daemon is started with --ipv6=true that the docker0 bridge
6466N/A+ if runtime.GOOS == "solaris" {
6466N/A // TestDaemonIPv6FixedCIDR checks that when the daemon is started with --ipv6=true and a fixed CIDR
6466N/A+ if runtime.GOOS == "solaris" {
6466N/A // TestDaemonIPv6FixedCIDRAndMac checks that when the daemon is started with ipv6 fixed CIDR
6466N/A // the running containers are given a an IPv6 address derived from the MAC address and the ipv6 fixed CIDR
6466N/A+ if runtime.GOOS == "solaris" {
6466N/A+ if runtime.GOOS == "solaris" {
6466N/Adiff --git a/integration-cli/docker_cli_events_test.go b/integration-cli/docker_cli_events_test.go
6466N/A- image := strings.Split(out, "\n")[0]
6466N/A+ //image := strings.Split(out, "\n")[0]
6466N/A c.Assert(err, checker.NotNil, check.Commentf("Container run with command blerg should have failed, but it did not, out=%s", out))
6466N/A out, _ = dockerCmd(c, "events", "--since=0", fmt.Sprintf("--until=%d", daemonTime(c).Unix()))
6466N/Adiff --git a/integration-cli/docker_cli_events_unix_test.go b/integration-cli/docker_cli_events_unix_test.go
6466N/A+ _ "github.com/kr/pty"
6466N/A- file, err := ioutil.TempFile("", "")
6466N/A- command := fmt.Sprintf("%s events --since=%d --until=%d > %s", dockerBinary, since, daemonTime(c).Unix(), file.Name())
6466N/A- cmd := exec.Command("sh", "-c", command)
6466N/A- cmd.Stdout = tty
6466N/A- cmd.Stderr = tty
6466N/A- scanner := bufio.NewScanner(file)
6466N/A- for scanner.Scan() {
6466N/A- for _, ch := range scanner.Text() {
6466N/A- c.Assert(unicode.IsControl(ch), checker.False, check.Commentf("found control character %v", []byte(string(ch))))
6466N/A+ file, err := ioutil.TempFile("", "")
6466N/A+ command := fmt.Sprintf("%s events --since=%d --until=%d > %s", dockerBinary, since, daemonTime(c).Unix(), file.Name())
6466N/A+ cmd := exec.Command("sh", "-c", command)
6466N/A+ cmd.Stdout = tty
6466N/A+ cmd.Stderr = tty
6466N/A+ scanner := bufio.NewScanner(file)
6466N/A+ for scanner.Scan() {
6466N/A+ for _, ch := range scanner.Text() {
6466N/A+ c.Assert(unicode.IsControl(ch), checker.False, check.Commentf("found control character %v", []byte(string(ch))))
6466N/Adiff --git a/integration-cli/docker_cli_exec_unix_test.go b/integration-cli/docker_cli_exec_unix_test.go
6466N/Adiff --git a/integration-cli/docker_cli_images_test.go b/integration-cli/docker_cli_images_test.go
6466N/A out, _ := dockerCmd(c, "commit", "-c", "LABEL foo.version=1.0.0-1", "-c", "LABEL foo.name=bar", "-c", "LABEL foo.author=starlord", "bar", "bar:1.0.0-1")
6466N/A imageID := strings.TrimSpace(out)
6466N/A@@ -235,7 +235,7 @@ func (s *DockerSuite) TestImagesEnsureImagesFromScratchShown(c *check.C) {
6466N/Adiff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go
6466N/A //JSON SizeRw and SizeRootFs field. If there is no flag --size/-s, there are no size fields.
6466N/A c.Assert(strings.TrimSpace(out), check.Equals, "<nil>,<nil>", check.Commentf("Exepcted not to display size info: %s", out))
6466N/A sz := strings.Split(out, ",")
6466N/A out, _, err := dockerCmdWithError("inspect", "--type=container", "--format='Format container: {{.ThisDoesNotExist}}'", "container1")
6466N/A- out, _, err = dockerCmdWithError("inspect", "--type=image", "--format='Format container: {{.ThisDoesNotExist}}'", "busybox")
6466N/A+ out, _, err = dockerCmdWithError("inspect", "--type=image", "--format='Format container: {{.ThisDoesNotExist}}'", "solaris")
6466N/A out, _, err := dockerCmdWithError("inspect", "--type=container", "--format='{{.HostConfig.Dns}}'", "busybox")
6466N/A out, _, err := dockerCmdWithError("inspect", "--type=container", "--format='{{.Name}}'", "busybox", "missing", "not-shown")
6466N/Adiff --git a/integration-cli/docker_cli_links_test.go b/integration-cli/docker_cli_links_test.go
6466N/Adiff --git a/integration-cli/docker_cli_links_unix_test.go b/integration-cli/docker_cli_links_unix_test.go
6466N/Aindex 1af9279..ebfd960 100644
6466N/Adiff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go
6466N/Aindex 24dd8a9..b1b7fd1 100644
6466N/A firstID := strings.TrimSpace(out)
6466N/A secondID := strings.TrimSpace(out)
6466N/A thirdID := strings.TrimSpace(out)
6466N/A fourthID := strings.TrimSpace(out)
6466N/A@@ -119,7 +119,7 @@ func (s *DockerSuite) TestPsListContainersDeprecatedSinceAndBefore(c *check.C) {
6466N/A secondID := strings.TrimSpace(out)
6466N/A thirdID := strings.TrimSpace(out)
6466N/A fields := strings.Fields(lines[1])
6466N/A c.Assert(fields[len(fields)-2], checker.Equals, expected, check.Commentf("Expected: %v, got: %v", expected, fields[len(fields)-2]))
6466N/A- out, _ := dockerCmd(c, "run", "--name", "testfoonamedcontainer", "busybox", "echo", "test")
6466N/A+ out, _ := dockerCmd(c, "run", "--name", "testfoonamedcontainer", "solaris", "echo", "test")
6466N/A out = strings.TrimSpace(out)
6466N/A@@ -172,7 +172,7 @@ func (s *DockerSuite) TestRunLinksContainerWithContainerName(c *check.C) {
6466N/A ip, err := inspectField("parent", "NetworkSettings.Networks.bridge.IPAddress")
6466N/A cID = strings.TrimSpace(cID)
6466N/A ip, err := inspectField(cID, "NetworkSettings.Networks.bridge.IPAddress")
6466N/A if !strings.Contains(out, "flag provided but not defined: --exec-opt") { // no daemon (client-only)
6466N/A out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", `c:\some\dir`, WindowsBaseImage, `cmd /c echo hello > c:\some\dir\file`)
6466N/A- out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", "/some/dir", "busybox", "touch", "/some/dir/file")
6466N/A+ out, exitCode = dockerCmd(c, "run", "--name", "test-data", "--volume", "/some/dir", "solaris", "touch", "/some/dir/file")
6466N/A out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", WindowsBaseImage, `cmd /c type c:\some\dir\file`)
6466N/A- out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", "busybox", "cat", "/some/dir/file")
6466N/A+ out, exitCode = dockerCmd(c, "run", "--volumes-from", "test-data", "solaris", "cat", "/some/dir/file")
6466N/A- dockerFile = fmt.Sprintf("FROM busybox\nRUN mkdir -p %s\nRUN ln -s %s /test", dir, dir)
6466N/A+ dockerFile = fmt.Sprintf("FROM solaris\nRUN mkdir -p %s\nRUN ln -s %s /test", dir, dir)
6466N/A containerPath = "/test/test"
6466N/A- if _, code, err := dockerCmdWithError("run", "-v", "/test:/test:ro", "busybox", "touch", "/test/somefile"); err == nil || code == 0 {
6466N/A+ if _, code, err := dockerCmdWithError("run", "-v", "/test:/test:ro", "solaris", "touch", "/test/somefile"); err == nil || code == 0 {
6466N/A@@ -401,16 +401,16 @@ func (s *DockerSuite) TestRunVolumesFromInReadonlyModeFails(c *check.C) {
6466N/A fileInVol = `c:/test/file`
6466N/A fileInVol = `/test/file`
6466N/A- if _, code, err := dockerCmdWithError("run", "--volumes-from", "parent:ro", "busybox", "touch", fileInVol); err == nil || code == 0 {
6466N/A+ if _, code, err := dockerCmdWithError("run", "--volumes-from", "parent:ro", "solaris", "touch", fileInVol); err == nil || code == 0 {
6466N/A fileInVol = `c:/test/file`
6466N/A fileInVol = "/test/file"
6466N/A- if out, _, err := dockerCmdWithError("run", "--volumes-from", "parent:bar", "busybox", "touch", fileInVol); err == nil || !strings.Contains(out, `invalid mode: "bar"`) {
6466N/A+ if out, _, err := dockerCmdWithError("run", "--volumes-from", "parent:bar", "solaris", "touch", fileInVol); err == nil || !strings.Contains(out, `invalid mode: "bar"`) {
6466N/A- if _, _, err := dockerCmdWithError("run", "--volumes-from", "parent:rw", "busybox", "touch", "/test/file"); err == nil {
6466N/A+ if _, _, err := dockerCmdWithError("run", "--volumes-from", "parent:rw", "solaris", "touch", "/test/file"); err == nil {
6466N/A- if _, _, err := dockerCmdWithError("run", "--volumes-from", "parent2:ro", "busybox", "touch", "/test/file"); err == nil {
6466N/A+ if _, _, err := dockerCmdWithError("run", "--volumes-from", "parent2:ro", "solaris", "touch", "/test/file"); err == nil {
6466N/A- if out, _, err := dockerCmdWithError("run", "-v", mountstr1, "-v", mountstr2, "busybox", "true"); err == nil {
6466N/A+ if out, _, err := dockerCmdWithError("run", "-v", mountstr1, "-v", mountstr2, "solaris", "true"); err == nil {
6466N/A if !strings.Contains(out, "Duplicate mount point") {
6466N/A- dockerCmd(c, "run", "--name", "parent", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo")
6466N/A- dockerCmd(c, "run", "--volumes-from", "parent", "-v", prefix+"/test", "busybox", "cat", prefix+"/test/foo")
6466N/A+ dockerCmd(c, "run", "--name", "parent", "-v", prefix+"/test", "solaris", "touch", prefix+"/test/foo")
6466N/A+ dockerCmd(c, "run", "--volumes-from", "parent", "-v", prefix+"/test", "solaris", "cat", prefix+"/test/foo")
6466N/A- dockerCmd(c, "run", "--name", "parent1", "-v", prefix+"/test", "busybox", "touch", prefix+"/test/foo")
6466N/A- dockerCmd(c, "run", "--name", "parent2", "-v", prefix+"/other", "busybox", "touch", prefix+"/other/bar")
6466N/A- dockerCmd(c, "run", "--volumes-from", "parent1", "--volumes-from", "parent2", "busybox", "sh", "-c", "cat /test/foo && cat /other/bar")
6466N/A+ dockerCmd(c, "run", "--name", "parent1", "-v", prefix+"/test", "solaris", "touch", prefix+"/test/foo")
6466N/A+ dockerCmd(c, "run", "--name", "parent2", "-v", prefix+"/other", "solaris", "touch", prefix+"/other/bar")
6466N/A+ dockerCmd(c, "run", "--volumes-from", "parent1", "--volumes-from", "parent2", "solaris", "sh", "-c", "cat /test/foo && cat /other/bar")
6466N/A- dockerCmd(c, "run", "-v", prefix+"/var/lib/data", "busybox", "true")
6466N/A+ dockerCmd(c, "run", "-v", prefix+"/var/lib/data", "solaris", "true")
6466N/A buildCmd := exec.Command(dockerBinary, "build", "-t", image, "-")
6466N/A buildCmd.Dir = workingDirectory
6466N/A err := buildCmd.Run()
6466N/A- _, exitCode, err = dockerCmdWithError("run", "--volumes-from", "test-volumesfromsymlinkpath", "busybox", "sh", "-c", "ls "+prefix+"/foo | grep -q bar")
6466N/A+ _, exitCode, err = dockerCmdWithError("run", "--volumes-from", "test-volumesfromsymlinkpath", "solaris", "sh", "-c", "ls "+prefix+"/foo | grep -q bar")
6466N/A if !strings.Contains(out, expected) {
6466N/A if !strings.Contains(out, "uid=0(root) gid=0(root)") {
6466N/A if !strings.Contains(out, "uid=1(daemon) gid=1(daemon)") {
6466N/A- cmd := exec.Command(dockerBinary, "run", "-e", "FOO", "-e", "HOSTNAME", "busybox", "env")
6466N/A+ cmd := exec.Command(dockerBinary, "run", "-e", "FOO", "-e", "HOSTNAME", "solaris", "env")
6466N/A // Windows busybox will fail with Permission Denied on items such as pagefile.sys
6466N/A@@ -1175,7 +1175,7 @@ func (s *DockerSuite) TestRunDisallowBindMountingRootToRoot(c *check.C) {
6466N/A@@ -1315,7 +1315,7 @@ func (s *DockerSuite) TestRunDnsOptionsBasedOnHostResolvConf(c *check.C) {
6466N/A hostSearch = resolvconf.GetSearchDomains(resolvConf)
6466N/A- out, _ = dockerCmd(c, "run", "busybox", "cat", "/etc/resolv.conf")
6466N/A+ out, _ = dockerCmd(c, "run", "solaris", "cat", "/etc/resolv.conf")
6466N/A if actualNameservers = resolvconf.GetNameservers([]byte(out), netutils.IP); string(actualNameservers[0]) != "12.34.56.78" || len(actualNameservers) != 1 {
6466N/A- _, exitCode := dockerCmd(c, "run", "-t", "-a", "stdout", "-a", "stderr", "busybox", "true")
6466N/A+ _, exitCode := dockerCmd(c, "run", "-t", "-a", "stdout", "-a", "stderr", "solaris", "true")
6466N/A- cmd := exec.Command(dockerBinary, "run", "-d", "--attach", "stdout", "busybox", "true")
6466N/A+ cmd := exec.Command(dockerBinary, "run", "-d", "--attach", "stdout", "solaris", "true")
6466N/A+ out, exit := dockerCmd(c, "run", "--entrypoint", "/bin/whoami", name)
6466N/A if !(err != nil && exitCode == 125 && strings.Contains(out, expected)) {
6466N/A c.Fatalf("Docker must complains about making dir with exitCode 125 but we got out: %s, exitCode: %d", out, exitCode)
6466N/A- runCmd := exec.Command(dockerBinary, "run", "--name", name, "-i", "busybox", meow)
6466N/A+ runCmd := exec.Command(dockerBinary, "run", "--name", name, "-i", "solaris", meow)
6466N/A stdin, err := runCmd.StdinPipe()
6466N/A cID := strings.TrimSpace(out1)
6466N/A- out, _ = dockerCmd(c, "run", "--name", name, "--entrypoint", "cmd /s /c echo", "busybox", "foobar")
6466N/A+ out, _ = dockerCmd(c, "run", "--name", name, "--entrypoint", "cmd /s /c echo", "solaris", "foobar")
6466N/A- out, _ = dockerCmd(c, "run", "--name", name, "--entrypoint", "/bin/echo", "busybox", "-n", "foobar")
6466N/A+ out, _ = dockerCmd(c, "run", "--name", name, "--entrypoint", "/bin/echo", "solaris", "foobar")
6466N/A- out, _ := dockerCmd(c, "run", "-v", fmt.Sprintf("%s:/tmp:ro", tmpDir), "busybox", "ls", "/tmp")
6466N/A+ out, _ := dockerCmd(c, "run", "-v", fmt.Sprintf("%s:/tmp:ro", tmpDir), "solaris", "ls", "/tmp")
6466N/A if !strings.Contains(out, "touch-me") {
6466N/A dockerCmd(c, "run", "-v", fmt.Sprintf(`%s:c:\tmp:rw`, tmpDir), "busybox", "touch", "c:/tmp/holla")
6466N/A- dockerCmd(c, "run", "-v", fmt.Sprintf("%s:/tmp:rw", tmpDir), "busybox", "touch", "/tmp/holla")
6466N/A+ dockerCmd(c, "run", "-v", fmt.Sprintf("%s:/tmp:rw", tmpDir), "solaris", "touch", "/tmp/holla")
6466N/A- _, _, err = dockerCmdWithError("run", "-v", fmt.Sprintf("%s:.", tmpDir), "busybox", "ls", ".")
6466N/A+ _, _, err = dockerCmdWithError("run", "-v", fmt.Sprintf("%s:.", tmpDir), "solaris", "ls", ".")
6466N/A- dockerCmd(c, "run", "-v", fmt.Sprintf("%s/holla:/tmp/holla:rw", tmpDir), "busybox", "sh", "-c", "echo -n 'yotta' > /tmp/holla")
6466N/A+ dockerCmd(c, "run", "-v", fmt.Sprintf("%s/holla:/tmp/holla:rw", tmpDir), "solaris", "sh", "-c", "echo 'yotta' > /tmp/holla")
6466N/A defer os.RemoveAll(tmpDir)
6466N/A } else if !strings.Contains(out, "No command specified") {
6466N/A defer os.RemoveAll(tmpDir)
6466N/A id := strings.TrimSpace(out)
6466N/A buffer, err := ioutil.ReadFile(tmpCidFile)
6466N/A out, _ = dockerCmd(c, "run", "-i", "--rm", fmt.Sprintf("--mac-address=%s", mac), "busybox", "sh", "-c", "ipconfig /all | grep 'Physical Address' | awk '{print $12}'")
6466N/A- out, _ = dockerCmd(c, "run", "-i", "--rm", fmt.Sprintf("--mac-address=%s", mac), "busybox", "/bin/sh", "-c", "ip link show eth0 | tail -1 | awk '{print $2}'")
6466N/A+ out, _ = dockerCmd(c, "run", "-i", "--rm", fmt.Sprintf("--mac-address=%s", mac), "solaris", "/bin/sh", "-c", "ip link show eth0 | tail -1 | awk '{print $2}'")
6466N/A actualMac := strings.TrimSpace(out)
6466N/A if err == nil || !strings.Contains(out, "is not a valid mac address") {
6466N/A "ls "+prefix+"/tmp/touch-me && ls "+prefix+"/tmp/foo/touch-me && ls "+prefix+"/tmp/tmp2/touch-me && ls "+prefix+"/tmp/tmp2/foo/touch-me")
6466N/A if err == nil || !strings.Contains(out, "Invalid range format for --expose") {
6466N/A cID := strings.TrimSpace(out)
6466N/A- cmd := exec.Command(dockerBinary, "run", "-ti", "busybox", "true")
6466N/A+ cmd := exec.Command(dockerBinary, "run", "-ti", "solaris", "true")
6466N/A if _, err := cmd.StdinPipe(); err != nil {
6466N/A- if out, _ := dockerCmd(c, "run", "--mac-address", addr, image, cmd); !strings.Contains(out, expected) {
6466N/A+ if out, _ := dockerCmd(c, "run", "--mac-address", addr, image, "ifconfig", "-a"); !strings.Contains(out, expected) {
6466N/A@@ -2690,7 +2691,7 @@ func (s *DockerSuite) TestRunAllowPortRangeThroughPublish(c *check.C) {
6466N/A out, err := inspectField("test", "HostConfig.RestartPolicy.Name")
6466N/A timeout := 10 * time.Second
6466N/A timeout = 45 * time.Second
6466N/A@@ -2816,8 +2817,8 @@ func (s *DockerSuite) TestRunVolumesFromRestartAfterRemoved(c *check.C) {
6466N/A- dockerCmd(c, "run", "-d", "--name", "voltest", "-v", prefix+"/foo", "busybox", "sleep", "60")
6466N/A- dockerCmd(c, "run", "-d", "--name", "restarter", "--volumes-from", "voltest", "busybox", "sleep", "60")
6466N/A+ dockerCmd(c, "run", "-d", "--name", "voltest", "-v", prefix+"/foo", "solaris", "sleep", "60")
6466N/A+ dockerCmd(c, "run", "-d", "--name", "restarter", "--volumes-from", "voltest", "solaris", "sleep", "60")
6466N/A@@ -2829,7 +2830,7 @@ func (s *DockerSuite) TestRunVolumesFromRestartAfterRemoved(c *check.C) {
6466N/A- out, _, err := dockerCmdWithError("run", "--name", name, "--rm", "busybox", "ls", "/notexists")
6466N/A+ out, _, err := dockerCmdWithError("run", "--name", name, "--rm", "solaris", "ls", "/notexists")
6466N/A@@ -2846,7 +2847,7 @@ func (s *DockerSuite) TestRunContainerWithRmFlagExitCodeNotEqualToZero(c *check.
6466N/A- out, _, err := dockerCmdWithError("run", "--name", name, "--rm", "busybox", "commandNotFound")
6466N/A+ out, _, err := dockerCmdWithError("run", "--name", name, "--rm", "solaris", "commandNotFound")
6466N/A- dockerCmd(c, "run", "--volumes-from", "parent:ro", "--name", "test-volumes-1", "busybox", "true")
6466N/A+ dockerCmd(c, "run", "--volumes-from", "parent:ro", "--name", "test-volumes-1", "solaris", "true")
6466N/A- dockerCmd(c, "run", "--volumes-from", "parent:rw", "--name", "test-volumes-2", "busybox", "true")
6466N/A+ dockerCmd(c, "run", "--volumes-from", "parent:rw", "--name", "test-volumes-2", "solaris", "true")
6466N/A@@ -3267,7 +3268,7 @@ func (s *DockerTrustSuite) TestTrustedRunFromBadTrustServer(c *check.C) {
6466N/A pushCmd := exec.Command(dockerBinary, "push", repoName)
6466N/A s.trustedCmd(pushCmd)
6466N/A@@ -3304,7 +3305,7 @@ func (s *DockerTrustSuite) TestTrustedRunFromBadTrustServer(c *check.C) {
6466N/A // In order to make an evil server, lets re-init a client (with a different trust dir) and push new data.
6466N/A pushCmd = exec.Command(dockerBinary, "--config", evilLocalConfigDir, "push", repoName)
6466N/A id := strings.TrimSpace(out)
6466N/A- _, exitCode, _ := dockerCmdWithError("run", "busybox", "sh", "-c", "sh -c readlink /proc/1/ns/net")
6466N/A+ _, exitCode, _ := dockerCmdWithError("run", "solaris", "sh", "-c", "sh -c readlink /proc/1/ns/net")
6466N/A- _, exitCode, _ := dockerCmdWithError("run", "busybox", "chmod", "744", "/proc/cpuinfo")
6466N/A+ _, exitCode, _ := dockerCmdWithError("run", "solaris", "chmod", "744", "/proc/cpuinfo")
6466N/A- _, exitCode, _ := dockerCmdWithError("run", "busybox", "chmod", "444", "/proc/cpuinfo")
6466N/A+ _, exitCode, _ := dockerCmdWithError("run", "solaris", "chmod", "444", "/proc/cpuinfo")
6466N/A- dockerCmd(c, "run", "--cap-drop=ALL", "--cap-add=SYS_TIME", "busybox", "sh", "-c", "grep ^CapEff /proc/self/status | sed 's/^CapEff:\t//' | grep ^0000000002000000$")
6466N/A+ dockerCmd(c, "run", "--cap-drop=ALL", "--cap-add=SYS_TIME", "solaris", "sh", "-c", "grep ^CapEff /proc/self/status | sed 's/^CapEff:\t//' | grep ^0000000002000000$")
6466N/A@@ -3393,7 +3394,7 @@ func (s *DockerSuite) TestRunCreateContainerFailedCleanUp(c *check.C) {
6466N/A- _, _, err := dockerCmdWithError("run", "--name", name, "--link", "nothing:nothing", "busybox")
6466N/A+ _, _, err := dockerCmdWithError("run", "--name", name, "--link", "nothing:nothing", "solaris")
6466N/A- dockerCmd(c, "run", "--name=test", "-v", "testing:"+prefix+slash+"foo", "busybox", "sh", "-c", "echo hello > "+prefix+"/foo/bar")
6466N/A+ dockerCmd(c, "run", "--name=test", "-v", "testing:"+prefix+slash+"foo", "solaris", "sh", "-c", "echo hello > "+prefix+"/foo/bar")
6466N/A- out, _ := dockerCmd(c, "run", "--volumes-from", "test", "busybox", "sh", "-c", "cat "+prefix+"/foo/bar")
6466N/A+ out, _ := dockerCmd(c, "run", "--volumes-from", "test", "solaris", "sh", "-c", "cat "+prefix+"/foo/bar")
6466N/A- out, _ = dockerCmd(c, "run", "-v", "testing:"+prefix+slash+"foo", "busybox", "sh", "-c", "cat "+prefix+"/foo/bar")
6466N/A+ out, _ = dockerCmd(c, "run", "-v", "testing:"+prefix+slash+"foo", "solaris", "sh", "-c", "cat "+prefix+"/foo/bar")
6466N/A- out, _ := dockerCmd(c, "run", "--name=testulimits", "--ulimit", "nofile=42", "busybox", "/bin/sh", "-c", "ulimit -n")
6466N/A+ out, _ := dockerCmd(c, "run", "--name=testulimits", "--ulimit", "nofile=42", "solaris", "/bin/sh", "-c", "ulimit -n")
6466N/A ul := strings.TrimSpace(out)
6466N/A- out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "busybox", "cat", "/proc/self/cgroup")
6466N/A+ out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "solaris", "cat", "/proc/self/cgroup")
6466N/A c.Fatalf("unexpected failure when running container with --cgroup-parent option - %s\n%v", string(out), err)
6466N/A@@ -3464,7 +3465,7 @@ func (s *DockerSuite) TestRunContainerWithCgroupParentAbsPath(c *check.C) {
6466N/A cgroupParent := "/cgroup-parent/test"
6466N/A- out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "busybox", "cat", "/proc/self/cgroup")
6466N/A+ out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "solaris", "cat", "/proc/self/cgroup")
6466N/A c.Fatalf("unexpected failure when running container with --cgroup-parent option - %s\n%v", string(out), err)
6466N/A- out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "busybox", "cat", "/proc/self/cgroup")
6466N/A+ out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "solaris", "cat", "/proc/self/cgroup")
6466N/A c.Fatalf("unexpected failure when running container with --cgroup-parent option - %s\n%v", string(out), err)
6466N/A- out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "busybox", "cat", "/proc/self/cgroup")
6466N/A+ out, _, err := dockerCmdWithError("run", "--cgroup-parent", cgroupParent, "--name", name, "solaris", "cat", "/proc/self/cgroup")
6466N/A c.Fatalf("unexpected failure when running container with --cgroup-parent option - %s\n%v", string(out), err)
6466N/A filename := "/sys/fs/cgroup/devices/test123"
6466N/A- out, _, err := dockerCmdWithError("run", "--name=me", "--net=container:me", "busybox", "true")
6466N/A+ out, _, err := dockerCmdWithError("run", "--name=me", "--net=container:me", "solaris", "true")
6466N/A if err == nil || !strings.Contains(out, "cannot join own network") {
6466N/A c.Fatalf("using container net mode to self should result in an error\nerr: %q\nout: %s", err, out)
6466N/A@@ -3593,22 +3594,22 @@ func (s *DockerSuite) TestRunContainerNetworkModeToSelf(c *check.C) {
6466N/A- out, _, err = dockerCmdWithError("run", "--dns", "1.2.3.4", "--net=container:parent", "busybox")
6466N/A+ out, _, err = dockerCmdWithError("run", "--dns", "1.2.3.4", "--net=container:parent", "solaris")
6466N/A- out, _, err = dockerCmdWithError("run", "--mac-address", "92:d0:c6:0a:29:33", "--net=container:parent", "busybox")
6466N/A+ out, _, err = dockerCmdWithError("run", "--mac-address", "92:d0:c6:0a:29:33", "--net=container:parent", "solaris")
6466N/A if err == nil || !strings.Contains(out, runconfig.ErrConflictContainerNetworkAndMac.Error()) {
6466N/A- out, _, err = dockerCmdWithError("run", "--add-host", "test:192.168.2.109", "--net=container:parent", "busybox")
6466N/A+ out, _, err = dockerCmdWithError("run", "--add-host", "test:192.168.2.109", "--net=container:parent", "solaris")
6466N/A@@ -3617,19 +3618,19 @@ func (s *DockerSuite) TestRunContainerNetModeWithDnsMacHosts(c *check.C) {
6466N/A- out, _, err := dockerCmdWithError("run", "-p", "5000:5000", "--net=container:parent", "busybox")
6466N/A+ out, _, err := dockerCmdWithError("run", "-p", "5000:5000", "--net=container:parent", "solaris")
6466N/A- out, _, err = dockerCmdWithError("run", "--expose", "5000", "--net=container:parent", "busybox")
6466N/A+ out, _, err = dockerCmdWithError("run", "--expose", "5000", "--net=container:parent", "solaris")
6466N/A@@ -3638,17 +3639,17 @@ func (s *DockerSuite) TestRunContainerNetModeWithExposePort(c *check.C) {
6466N/A- out, _ := dockerCmd(c, "run", "--net=none", "busybox", "ip", "-o", "-4", "a", "show", "up")
6466N/A+ out, _ := dockerCmd(c, "run", "--net=none", "solaris", "ip", "-o", "-4", "a", "show", "up")
6466N/A out, _ := dockerCmd(c, "exec", "parent", "cat", "/etc/hostname")
6466N/A- out1, _ := dockerCmd(c, "run", "--net=container:parent", "busybox", "cat", "/etc/hostname")
6466N/A+ out1, _ := dockerCmd(c, "run", "--net=container:parent", "solaris", "cat", "/etc/hostname")
6466N/A@@ -3696,7 +3697,7 @@ func (s *DockerSuite) TestRunNetworkNotInitializedNoneMode(c *check.C) {
6466N/A id := strings.TrimSpace(out)
6466N/A res, err := inspectField(id, "NetworkSettings.Networks.none.IPAddress")
6466N/A@@ -3708,8 +3709,8 @@ func (s *DockerSuite) TestRunNetworkNotInitializedNoneMode(c *check.C) {
6466N/A- dockerCmd(c, "run", "-t", "--net=testnetwork", "--name=second", "busybox", "ping", "-c", "1", "first")
6466N/A+ dockerCmd(c, "run", "-t", "--net=testnetwork", "--name=second", "solaris", "ping", "-c", "1", "first")
6466N/A dockerCmd(c, "exec", "first", "ping", "-c", "1", "second.testnetwork1")
6466N/A@@ -3793,9 +3794,9 @@ func (s *DockerSuite) TestContainerRestartInMultipleNetworks(c *check.C) {
6466N/A dockerCmd(c, "exec", "first", "ping", "-c", "1", "second.testnetwork1")
6466N/A@@ -3821,7 +3822,7 @@ func (s *DockerSuite) TestContainerRestartInMultipleNetworks(c *check.C) {
6466N/A@@ -3834,10 +3835,10 @@ func (s *DockerSuite) TestContainerWithConflictingHostNetworks(c *check.C) {
6466N/A@@ -3851,7 +3852,7 @@ func (s *DockerSuite) TestContainerWithConflictingSharedNetwork(c *check.C) {
6466N/A@@ -3863,7 +3864,7 @@ func (s *DockerSuite) TestContainerWithConflictingNoneNetwork(c *check.C) {
6466N/A@@ -3873,7 +3874,7 @@ func (s *DockerSuite) TestContainerWithConflictingNoneNetwork(c *check.C) {
6466N/A // #11957 - stdin with no tty does not exit if stdin is not closed even though container exited
6466N/A- cmd := exec.Command(dockerBinary, "run", "-i", "--name=test", "busybox", "true")
6466N/A+ cmd := exec.Command(dockerBinary, "run", "-i", "--name=test", "solaris", "true")
6466N/A in, err := cmd.StdinPipe()
6466N/A@@ -3895,7 +3896,7 @@ func (s *DockerSuite) TestRunStdinBlockedAfterContainerExit(c *check.C) {
6466N/A- out, exitCode, err := dockerCmdWithError("run", "--cpuset-cpus", "1-10,11--", "busybox", "true")
6466N/A+ out, exitCode, err := dockerCmdWithError("run", "--cpuset-cpus", "1-10,11--", "solaris", "true")
6466N/A if !(strings.Contains(out, expected) || exitCode == 125) {
6466N/A- out, exitCode, err := dockerCmdWithError("run", "--cpuset-mems", "1-42--", "busybox", "true")
6466N/A+ out, exitCode, err := dockerCmdWithError("run", "--cpuset-mems", "1-42--", "solaris", "true")
6466N/A if !(strings.Contains(out, expected) || exitCode == 125) {
6466N/A- runCmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "foo")
6466N/A+ runCmd := exec.Command(dockerBinary, "run", "--name", name, "solaris", "foo")
6466N/A if !(exit == 127 && strings.Contains(stateExitCode, "127")) {
6466N/A if !(exit == 127 && strings.Contains(stateExitCode, "127")) {
6466N/A- runCmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "/etc")
6466N/A+ runCmd := exec.Command(dockerBinary, "run", "--name", name, "solaris", "/etc")
6466N/A-// TestDockerFails checks that 'docker run -foo busybox' exits with 125 to signal docker run failed
6466N/A+// TestDockerFails checks that 'docker run -foo solaris' exits with 125 to signal docker run failed
6466N/A- runCmd := exec.Command(dockerBinary, "run", "-foo", "busybox")
6466N/A+ runCmd := exec.Command(dockerBinary, "run", "-foo", "solaris")
6466N/A c.Fatalf("Docker run with flag not defined should exit with 125, but we got out: %s, exit: %d, err: %s", out, exit, err)
6466N/A RUN echo 'dockerio:x:1001:' >> /etc/group
6466N/A- out, _ := dockerCmd(c, "run", "--oom-score-adj", expected, "busybox", "cat", "/proc/self/oom_score_adj")
6466N/A+ out, _ := dockerCmd(c, "run", "--oom-score-adj", expected, "solaris", "cat", "/proc/self/oom_score_adj")
6466N/A oomScoreAdj := strings.TrimSpace(out)
6466N/A if !strings.Contains(out, expected) {
6466N/A if !strings.Contains(out, expected) {
6466N/A- dockerCmd(c, "run", "--privileged", "-v", fmt.Sprintf("%s:/volume-dest:shared", tmpDir), "busybox", "mount", "--bind", "/volume-dest/mnt1", "/volume-dest/mnt1")
6466N/A+ dockerCmd(c, "run", "--privileged", "-v", fmt.Sprintf("%s:/volume-dest:shared", tmpDir), "solaris", "mount", "--bind", "/volume-dest/mnt1", "/volume-dest/mnt1")
6466N/A- dockerCmd(c, "run", "-i", "-d", "--name", "parent", "-v", fmt.Sprintf("%s:/volume-dest:slave", tmpDir), "busybox", "top")
6466N/A+ dockerCmd(c, "run", "-i", "-d", "--name", "parent", "-v", fmt.Sprintf("%s:/volume-dest:slave", tmpDir), "solaris", "top")
6466N/A // Bind mount tmpDir2/ onto tmpDir/mnt1. If mount propagates inside
6466N/A // container then contents of tmpDir2/slave-testfile should become
6466N/A- out, exitcode, _ := dockerCmdWithError("run", "-v", "foo:/test:shared", "busybox", "touch", "/test/somefile")
6466N/A+ out, exitcode, _ := dockerCmdWithError("run", "-v", "foo:/test:shared", "solaris", "touch", "/test/somefile")
6466N/A RUN mkdir -p /foo && echo hello > /foo/hello
6466N/A- out, _ := dockerCmd(c, "run", "-v", "foo:/foo", "busybox", "cat", "/foo/hello")
6466N/A+ out, _ := dockerCmd(c, "run", "-v", "foo:/foo", "solaris", "cat", "/foo/hello")
6466N/A- dockerCmd(c, "run", "--rm", "-v", "test:"+prefix+"/foo", "-v", prefix+"/bar", "busybox", "true")
6466N/A+ dockerCmd(c, "run", "--rm", "-v", "test:"+prefix+"/foo", "-v", prefix+"/bar", "solaris", "true")
6466N/A- dockerCmd(c, "run", "--name=test", "-v", "test:"+prefix+"/foo", "-v", prefix+"/bar", "busybox", "true")
6466N/A+ dockerCmd(c, "run", "--name=test", "-v", "test:"+prefix+"/foo", "-v", prefix+"/bar", "solaris", "true")
6466N/A- dockerCmd(c, "run", "--name=parent", "-v", "test:"+prefix+"/foo", "-v", prefix+"/bar", "busybox", "true")
6466N/A+ dockerCmd(c, "run", "--name=parent", "-v", "test:"+prefix+"/foo", "-v", prefix+"/bar", "solaris", "true")
6466N/Adiff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go
6466N/A tmpDir, err := ioutil.TempDir("", "docker_recursive_mount_test")
6466N/A- runCmd := exec.Command(dockerBinary, "run", "--name", "test-data", "--volume", fmt.Sprintf("%s:/tmp:ro", tmpDir), "busybox:latest", "ls", "/tmp/tmpfs")
6466N/A+ runCmd := exec.Command(dockerBinary, "run", "--name", "test-data", "--volume", fmt.Sprintf("%s:/tmp:ro", tmpDir), "solaris:latest", "ls", "/tmp/tmpfs")
6466N/A c.Assert(out, checker.Contains, filepath.Base(f.Name()), check.Commentf("Recursive bind mount test failed. Expected file not found"))
6466N/A cmd := exec.Command(dockerBinary, "attach", name)
6466N/A stdout, err := cmd.StdoutPipe()
6466N/A // TestRunDetach checks attaching and detaching with the escape sequence specified via flags.
6466N/A cmd := exec.Command(dockerBinary, "attach", "--detach-keys='ctrl-a,a'", name)
6466N/A stdout, err := cmd.StdoutPipe()
6466N/A // TestRunDetach checks attaching and detaching with the escape sequence specified via config file.
6466N/A cmd := exec.Command(dockerBinary, "attach", name)
6466N/A stdout, err := cmd.StdoutPipe()
6466N/A // TestRunDetach checks attaching and detaching with the detach flags, making sure it overrides config file
6466N/A@@ -309,7 +315,7 @@ func (s *DockerSuite) TestRunAttachDetachKeysOverrideConfig(c *check.C) {
6466N/A cmd := exec.Command(dockerBinary, "attach", "--detach-keys='ctrl-a,a'", name)
6466N/A stdout, err := cmd.StdoutPipe()
6466N/A@@ -367,10 +373,10 @@ func (s *DockerSuite) TestRunAttachDetachKeysOverrideConfig(c *check.C) {
6466N/A file := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"
6466N/A- out, _ := dockerCmd(c, "run", "--cpu-quota", "8000", "--name", "test", "busybox", "cat", file)
6466N/A+ out, _ := dockerCmd(c, "run", "--cpu-quota", "8000", "--name", "test", "solaris", "cat", file)
6466N/A out, err := inspectField("test", "HostConfig.CpuQuota")
6466N/A file := "/sys/fs/cgroup/cpu/cpu.cfs_period_us"
6466N/A out, _ := dockerCmd(c, "run", "--cpu-period", "50000", "--name", "test", "busybox", "cat", file)
6466N/A stdout, _, _ := dockerCmdWithStdoutStderr(c, "run", "--kernel-memory", "50M", "--name", "test1", "busybox", "cat", file)
6466N/A file := "/sys/fs/cgroup/cpu/cpu.shares"
6466N/A out, _ := dockerCmd(c, "run", "--cpu-shares", "1000", "--name", "test", "busybox", "cat", file)
6466N/A- out, _, _ := dockerCmdWithStdoutStderr(c, "run", "--cpu-shares", "1000", "-m", "32m", "busybox", "echo", "test")
6466N/A+ out, _, _ := dockerCmdWithStdoutStderr(c, "run", "--cpu-shares", "1000", "-m", "32m", "solaris", "echo", "test")
6466N/A c.Assert(out, checker.Equals, "test\n", check.Commentf("container should've printed 'test'"))
6466N/A file := "/sys/fs/cgroup/blkio/blkio.weight"
6466N/A- out, _ := dockerCmd(c, "run", "--blkio-weight", "300", "--name", "test", "busybox", "cat", file)
6466N/A+ out, _ := dockerCmd(c, "run", "--blkio-weight", "300", "--name", "test", "solaris", "cat", file)
6466N/A out, err := inspectField("test", "HostConfig.BlkioWeight")
6466N/A- out, _, err := dockerCmdWithError("run", "--blkio-weight-device", "/dev/sdX:100", "busybox", "true")
6466N/A+ out, _, err := dockerCmdWithError("run", "--blkio-weight-device", "/dev/sdX:100", "solaris", "true")
6466N/A- out, _, err := dockerCmdWithError("run", "--device-read-bps", "/dev/sdX:500", "busybox", "true")
6466N/A+ out, _, err := dockerCmdWithError("run", "--device-read-bps", "/dev/sdX:500", "solaris", "true")
6466N/A- out, _, err := dockerCmdWithError("run", "--device-write-bps", "/dev/sdX:500", "busybox", "true")
6466N/A+ out, _, err := dockerCmdWithError("run", "--device-write-bps", "/dev/sdX:500", "solaris", "true")
6466N/A- out, _, err := dockerCmdWithError("run", "--device-read-iops", "/dev/sdX:500", "busybox", "true")
6466N/A+ out, _, err := dockerCmdWithError("run", "--device-read-iops", "/dev/sdX:500", "solaris", "true")
6466N/A- out, _, err := dockerCmdWithError("run", "--device-write-iops", "/dev/sdX:500", "busybox", "true")
6466N/A+ out, _, err := dockerCmdWithError("run", "--device-write-iops", "/dev/sdX:500", "solaris", "true")
6466N/A //changing memory to 40MB from 4MB due to an issue with GCCGO that test fails to start the container.
6466N/A- out, exitCode, _ := dockerCmdWithError("run", "-m", "40MB", "busybox", "sh", "-c", "x=a; while true; do x=$x$x$x$x; done")
6466N/A+ out, exitCode, _ := dockerCmdWithError("run", "-m", "40MB", "solaris", "sh", "-c", "x=a; while true; do x=$x$x$x$x; done")
6466N/A errChan <- fmt.Errorf("wrong exit code for OOM container: expected %d, got %d (output: %q)", expected, exitCode, out)
6466N/A stdout, _, _ := dockerCmdWithStdoutStderr(c, "run", "-m", "32M", "--name", "test", "busybox", "cat", file)
6466N/A out, _ := dockerCmd(c, "run", "--stop-signal", "SIGUSR1", "-d", "busybox", "/bin/sh", "-c", `trap 'echo "exit trapped"; exit 0' USR1; while true; do sleep 1; done`)
6466N/A containerID := strings.TrimSpace(out)
6466N/Adiff --git a/integration-cli/docker_cli_save_load_unix_test.go b/integration-cli/docker_cli_save_load_unix_test.go
6466N/Aindex cef7d43..e0256b5 100644
6466N/Adiff --git a/integration-cli/docker_cli_start_volume_driver_unix_test.go b/integration-cli/docker_cli_start_volume_driver_unix_test.go
6466N/Aindex 6ee53b4..fd09c60 100644
6466N/A@@ -231,7 +231,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverNamed(c *check.C) {
6466N/A err := s.d.StartWithBusybox()
6466N/A- out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver", "busybox:latest", "cat", "/tmp/external-volume-test/test")
6466N/A+ out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver", "solaris:latest", "cat", "/tmp/external-volume-test/test")
6466N/A@@ -254,7 +254,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnnamed(c *check.C)
6466N/A err := s.d.StartWithBusybox()
6466N/A- out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver", "busybox:latest", "cat", "/tmp/external-volume-test/test")
6466N/A+ out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver", "solaris:latest", "cat", "/tmp/external-volume-test/test")
6466N/A@@ -269,10 +269,10 @@ func (s DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *check.
6466N/A err := s.d.StartWithBusybox()
6466N/A- out, err := s.d.Cmd("run", "-d", "--name", "vol-test1", "-v", "/foo", "--volume-driver", "test-external-volume-driver", "busybox:latest")
6466N/A+ out, err := s.d.Cmd("run", "-d", "--name", "vol-test1", "-v", "/foo", "--volume-driver", "test-external-volume-driver", "solaris:latest")
6466N/A- out, err = s.d.Cmd("run", "--rm", "--volumes-from", "vol-test1", "--name", "vol-test2", "busybox", "ls", "/tmp")
6466N/A+ out, err = s.d.Cmd("run", "--rm", "--volumes-from", "vol-test1", "--name", "vol-test2", "solaris", "ls", "/tmp")
6466N/A@@ -289,7 +289,7 @@ func (s DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *ch
6466N/A err := s.d.StartWithBusybox()
6466N/A- out, err := s.d.Cmd("run", "-d", "--name", "vol-test1", "-v", "/foo", "--volume-driver", "test-external-volume-driver", "busybox:latest")
6466N/A+ out, err := s.d.Cmd("run", "-d", "--name", "vol-test1", "-v", "/foo", "--volume-driver", "test-external-volume-driver", "solaris:latest")
6466N/A@@ -353,7 +353,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverRetryNotImmediatelyE
6466N/A- if out, err := s.d.Cmd("run", "--rm", "--name", "test-data-retry", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver-retry", "busybox:latest"); err != nil {
6466N/A+ if out, err := s.d.Cmd("run", "--rm", "--name", "test-data-retry", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", "test-external-volume-driver-retry", "solaris:latest"); err != nil {
6466N/A errchan <- fmt.Errorf("%v:\n%s", err, out)
6466N/A@@ -384,7 +384,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverRetryNotImmediatelyE
6466N/A func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c *check.C) {
6466N/Adiff --git a/integration-cli/docker_cli_volume_driver_compat_unix_test.go b/integration-cli/docker_cli_volume_driver_compat_unix_test.go
6466N/Aindex 2207822..cc054e3 100644
6466N/A@@ -191,7 +191,7 @@ func (s *DockerExternalVolumeSuiteCompatV1_1) TestExternalVolumeDriverCompatV1_1
6466N/A err := s.d.StartWithBusybox()
6466N/A- out, err := s.d.Cmd("run", "--name=test", "-v", "foo:/bar", "--volume-driver", "test-external-volume-driver", "busybox", "sh", "-c", "echo hello > /bar/hello")
6466N/A+ out, err := s.d.Cmd("run", "--name=test", "-v", "foo:/bar", "--volume-driver", "test-external-volume-driver", "solaris", "sh", "-c", "echo hello > /bar/hello")
6466N/Adiff --git a/integration-cli/docker_cli_volume_test.go b/integration-cli/docker_cli_volume_test.go
6466N/Aindex 5a19ba5..b81bff4 100644
6466N/A id := strings.TrimSpace(out)
6466N/A- dockerCmd(c, "run", "--name", "volume-test1", "-v", "testisinuse1:"+prefix+"/foo", "busybox", "true")
6466N/A- dockerCmd(c, "create", "--name", "volume-test2", "-v", "testisinuse2:"+prefix+"/foo", "busybox", "true")
6466N/A+ dockerCmd(c, "run", "--name", "volume-test1", "-v", "testisinuse1:"+prefix+"/foo", "solaris", "true")
6466N/A+ dockerCmd(c, "create", "--name", "volume-test2", "-v", "testisinuse2:"+prefix+"/foo", "solaris", "true")
6466N/A- dockerCmd(c, "run", "-v", volumeID+":"+prefix+"/foo", "--name=test", "busybox", "sh", "-c", "echo hello > /foo/bar")
6466N/A+ dockerCmd(c, "run", "-v", volumeID+":"+prefix+"/foo", "--name=test", "solaris", "sh", "-c", "echo hello > /foo/bar")
6466N/A out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "volume", "rm", "testing"))
6466N/A check.Commentf("Should not be able to remove volume that is in use by a container\n%s", out))
6466N/A- out, _ = dockerCmd(c, "run", "--volumes-from=test", "--name=test2", "busybox", "sh", "-c", "cat /foo/bar")
6466N/A+ out, _ = dockerCmd(c, "run", "--volumes-from=test", "--name=test2", "solaris", "sh", "-c", "cat /foo/bar")
6466N/A- out, _ = dockerCmd(c, "run", "--name=test2", "-v", volumeID+":"+prefix+"/foo", "busybox", "sh", "-c", "cat /foo/bar")
6466N/A+ out, _ = dockerCmd(c, "run", "--name=test2", "-v", volumeID+":"+prefix+"/foo", "solaris", "sh", "-c", "cat /foo/bar")
6466N/A c.Assert(strings.TrimSpace(out), check.Equals, "hello", check.Commentf("volume data was removed"))
6466N/Adiff --git a/integration-cli/docker_cli_wait_test.go b/integration-cli/docker_cli_wait_test.go
6466N/Aindex 2993397..c0d4217 100644
6466N/A containerID := strings.TrimSpace(out)
6466N/A containerID := strings.TrimSpace(out)
6466N/Aindex e876736..b3d542f 100644
6466N/A daemonPlatform = svrHeader.OS
6466N/A+ if daemonPlatform != "linux" && daemonPlatform != "windows" && daemonPlatform != "solaris" {
6466N/Aindex 853889a..eae442f 100644
6466N/A- DefaultUnixSocket = "/var/run/docker.sock"
6466N/A DefaultTCPHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultHTTPPort)
6466N/A+// DefaultHost constant defines the default host string used by docker on other hosts than Windows
6466N/A+var DefaultHost = fmt.Sprintf("unix://%s", DefaultUnixSocket)
6466N/A+var DefaultUnixSocket = "/system/volatile/docker/docker.sock"
6466N/Aindex e497e28..cd65f82 100644
6466N/A- var defaultHOST = "unix:///var/run/docker.sock"
6466N/A+ var defaultHOST = "unix:///system/volatile/docker/docker.sock"
6466N/A if runtime.GOOS == "windows" {
6466N/A- "unix://": "unix:///var/run/docker.sock", // default unix:// value
6466N/A+ "unix://": "unix:///system/volatile/docker/docker.sock", // default unix:// value
6466N/A // DefaultHost constant defines the default host string used by docker on other hosts than Windows
6466N/A var DefaultHost = fmt.Sprintf("unix://%s", DefaultUnixSocket)
6466N/A+var DefaultUnixSocket = "/var/run/docker.sock"
6466N/A- cmd := exec.Command("/bin/sh", "-c", "dd if=/dev/zero bs=1K count=1 of=/tmp/archive && gzip --stdout /tmp/archive > /tmp/archive.gz")
6466N/A+ cmd := exec.Command("/bin/sh", "-c", "dd if=/dev/zero bs=1 count=1 of=/tmp/archive && gzip --stdout /tmp/archive > /tmp/archive.gz")
6466N/A output, err := cmd.CombinedOutput()
6466N/A if err := ioutil.WriteFile(path.Join(origin, "3"), []byte("will be ignored"), 0700); err != nil {
6466N/A- if err := system.Lsetxattr(path.Join(origin, "2"), "security.capability", []byte{0x00}, 0); err != nil {
6466N/A+ //if err := system.Lsetxattr(path.Join(origin, "2"), "security.capability", []byte{0x00}, 0); err != nil {
6466N/A if err := ioutil.WriteFile(path.Join(origin, "1"), []byte("hello world"), 0700); err != nil {
6466N/A- if err := system.Mknod(path.Join(origin, "2"), syscall.S_IFBLK, int(system.Mkdev(int64(12), int64(5)))); err != nil {
6466N/A- if err := system.Mknod(path.Join(origin, "3"), syscall.S_IFCHR, int(system.Mkdev(int64(12), int64(5)))); err != nil {
6466N/A- if err := system.Mknod(path.Join(origin, "4"), syscall.S_IFIFO, int(system.Mkdev(int64(12), int64(5)))); err != nil {
6466N/A+ /* if err := system.Mknod(path.Join(origin, "2"), syscall.S_IFBLK, int(system.Mkdev(int64(12), int64(5)))); err != nil {
6466N/A+ if err := system.Mknod(path.Join(origin, "3"), syscall.S_IFCHR, int(system.Mkdev(int64(12), int64(5)))); err != nil {
6466N/A+ if err := system.Mknod(path.Join(origin, "4"), syscall.S_IFIFO, int(system.Mkdev(int64(12), int64(5)))); err != nil {
6466N/A dest, err := ioutil.TempDir("", "docker-test-tar-hardlink-dest")
6466N/A- cmd := exec.Command("cp", "-a", src, dst)
6466N/A+ //cmd := exec.Command("cp", "-a", src, dst)
6466N/A+ cmd := exec.Command("gcp", "-a", src, dst)
6466N/Aindex 1d6c2b9..c7e1ab6 100644
6466N/A if err := system.MkdirAll(src, 0700); err != nil {
6466N/A dest := filepath.Join(tmpdir, "dest")
6466N/A if err := system.MkdirAll(src, 0700); err != nil {
6466N/A- srcLinkfile := filepath.Join(src, "file-1-link")
6466N/A- dest = filepath.Join(tmpdir, "destSymlink")
6466N/A- destLinkfile := filepath.Join(dest, "file-1-link")
6466N/A+ srcLinkfile := filepath.Join(src, "file-1-link")
6466N/A+ dest = filepath.Join(tmpdir, "destSymlink")
6466N/A+ destLinkfile := filepath.Join(dest, "file-1-link")
6466N/A if err := system.MkdirAll(src, 0700); err != nil {
6466N/A- srcLinkfile := filepath.Join(src, "file-1-link")
6466N/A- dest = filepath.Join(tmpdir, "destSymlink")
6466N/A- destLinkfile := filepath.Join(dest, "file-1-link")
6466N/A+ srcLinkfile := filepath.Join(src, "file-1-link")
6466N/A+ dest = filepath.Join(tmpdir, "destSymlink")
6466N/A+ destLinkfile := filepath.Join(dest, "file-1-link")
6466N/A if err := system.MkdirAll(src, 0700); err != nil {
6466N/A dest := filepath.Join(tmpdir, "dest")
6466N/Aindex 4196dd4..ade5210 100644
6466N/A fatal(fmt.Errorf("unable to encode layerSize JSON: %s", err))
6466N/Aindex dbebdd3..b43c79f 100644
6466N/Aindex 8920834..ef3e30f 100644
6466N/A- longCmd := exec.Command("top")
6466N/A+ //longCmd := exec.Command("top")
6466N/A+ longCmd := exec.Command("sleep", "30")
6466N/A t.Fatalf("Expected command to output %s, got %s, %v with exitCode %v", expectedError, out, err, exitCode)
6466N/A- wrongLsCmd := exec.Command("ls", "-z")
6466N/A+ wrongLsCmd := exec.Command("gls", "-z")
6466N/A exec.Command("wc", "-m"),
6466N/A t.Fatalf("Expected %s for commands %v, got out:%s, exitCode:%d, err:%v", expectedOutput, cmds, out, exitCode, err)
6466N/Aindex 0000000..ad170a0
6466N/A+#include <sys/mount.h>
6466N/A+ RDONLY = C.MS_RDONLY
6466N/A+ NOSUID = C.MS_NOSUID
6466N/Aindex ed7216e..f85733f 100644
6466N/A // Mounted looks at /proc/self/mountinfo to determine of the specified
6466N/Aindex 0000000..c684aa8
6466N/A+// #include <sys/mount.h>
6466N/A+ err := unix.Unmount(target, flag)
6466N/Aindex eb93365..aa006fe 100644
6466N/A+#include <sys/mnttab.h>
6466N/A+ var mp C.struct_mnttab
6466N/A+ ret := C.getmntent(mnttab, &mp)
6466N/A+ ret = C.getmntent(mnttab, &mp)
6466N/A+func uname() (*unix.Utsname, error) {
6466N/A+ uts := &unix.Utsname{}
6466N/A+ if err := unix.Uname(uts); err != nil {
6466N/Adiff --git a/pkg/parsers/kernel/uname_unsupported.go b/pkg/parsers/kernel/uname_unsupported.go
6466N/Adiff --git a/pkg/parsers/operatingsystem/operatingsystem_solaris.go b/pkg/parsers/operatingsystem/operatingsystem_solaris.go
6466N/A+var etcOsRelease = "/etc/release"
6466N/A+ b, err := ioutil.ReadFile(etcOsRelease)
6466N/A+ if i := bytes.Index(b, []byte("\n")); i >= 0 {
6466N/A+ b = bytes.Trim(b[:i], " ")
6466N/A+ return "", errors.New("release not found")
6466N/A+ if C.getzoneid() != 0 {
6466N/Aindex 0000000..ecd769e
6466N/A+ machine, err := cmd.Output()
6466N/A+ return strings.TrimSpace(string(machine)), nil
6466N/A- defer backend.Close()
6466N/A- proxy, err := NewProxy(frontendAddr, backend.LocalAddr())
6466N/A+ defer backend.Close()
6466N/A+ proxy, err := NewProxy(frontendAddr, backend.LocalAddr())
6466N/A- defer backend.Close()
6466N/A- proxy, err := NewProxy(frontendAddr, backend.LocalAddr())
6466N/A+ defer backend.Close()
6466N/A+ proxy, err := NewProxy(frontendAddr, backend.LocalAddr())
6466N/A+// be set to "/usr/bin/docker".
6466N/A+var SignalMap = map[string]syscall.Signal{
6466N/A+ "ABRT": syscall.SIGABRT,
6466N/A+ "ALRM": syscall.SIGALRM,
6466N/A+ "BUF": syscall.SIGBUS,
6466N/A+ "CHLD": syscall.SIGCHLD,
6466N/A+ "CONT": syscall.SIGCONT,
6466N/A+ "EMT": syscall.SIGEMT,
6466N/A+ "FPE": syscall.SIGFPE,
6466N/A+ "HUP": syscall.SIGHUP,
6466N/A+ "ILL": syscall.SIGILL,
6466N/A+ "INT": syscall.SIGINT,
6466N/A+ "IO": syscall.SIGIO,
6466N/A+ "IOT": syscall.SIGIOT,
6466N/A+ "KILL": syscall.SIGKILL,
6466N/A+ "LWP": syscall.SIGLWP,
6466N/A+ "PIPE": syscall.SIGPIPE,
6466N/A+ "PROF": syscall.SIGPROF,
6466N/A+ "QUIT": syscall.SIGQUIT,
6466N/A+ "SEGV": syscall.SIGSEGV,
6466N/A+ "STOP": syscall.SIGSTOP,
6466N/A+ "SYS": syscall.SIGSYS,
6466N/A+ "TERM": syscall.SIGTERM,
6466N/A+ "TRAP": syscall.SIGTRAP,
6466N/A+ "TSTP": syscall.SIGTSTP,
6466N/A+ "TTIN": syscall.SIGTTIN,
6466N/A+ "TTOU": syscall.SIGTTOU,
6466N/A+ "URG": syscall.SIGURG,
6466N/A+ "USR1": syscall.SIGUSR1,
6466N/A+ "USR2": syscall.SIGUSR2,
6466N/A+ "VTALRM": syscall.SIGVTALRM,
6466N/A+ "WINCH": syscall.SIGWINCH,
6466N/A+ "XCPU": syscall.SIGXCPU,
6466N/A+ "XFSZ": syscall.SIGXFSZ,
6466N/Aindex 161ba27..c592d37 100644
6466N/Aindex 0000000..f8314c4
6466N/A+#include <sys/lgrp_user.h>
6466N/A+ outBuf := new(bytes.Buffer)
6466N/A+ errBuf := new(bytes.Buffer)
6466N/A+ cmd.Stderr = errBuf
6466N/A+ cmd.Stdout = outBuf
6466N/A+// to update verifyPlatformContainerSettings() in daemon_solaris.go
6466N/A+ sysInfo.cgroupMemInfo = setCgroupMem(quiet)
6466N/A+ sysInfo.cgroupCPUInfo = setCgroupCPU(quiet)
6466N/A+ sysInfo.cgroupBlkioInfo = setCgroupBlkioInfo(quiet)
6466N/A+ sysInfo.cgroupCpusetInfo = setCgroupCpusetInfo(quiet)
6466N/A+ sysInfo.IPv4ForwardingDisabled = false
6466N/A+ sysInfo.AppArmor = false
6466N/A+ return strconv.FormatInt(int64(ncpus), 16)
6466N/A+ nlgrps := C.getLgrpCount()
6466N/A+ return strconv.FormatInt(int64(nlgrps), 16)
7068N/Aindex 0000000..bad227f
6466N/A+// #include <sys/swap.h>
6466N/A+// #include <sys/param.h>
6466N/A+// pp_kernel = knp->value.ui64;
6466N/A+// pp_kernel = knp->value.ui32;
6466N/A+ ppKernel := C.getPpKernel()
6466N/A+ return nil, fmt.Errorf("Error getting system memory info %v\n", err)
7068N/A+ meminfo.MemTotal = MemTotal
6466N/A+ meminfo.MemFree = MemFree
6466N/A+ meminfo.SwapTotal = SwapTotal
6466N/A+ meminfo.SwapFree = SwapFree
6466N/A+ fmt.Printf("Return from swapctl num: %d and err: %+v\n", num, err)
6466N/A+ st := C.allocSwaptable(num)
6466N/A+ fmt.Printf("Return from swapctl list and err: %+v\n", err)
6466N/A+ C.freeSwaptable(st)
6466N/A+ fmt.Printf("Return from swapctl: %#v\n", st)
6466N/A+ tSwap += int64(swapent.ste_pages) * diskblksPerPage
6466N/A+ fSwap += int64(swapent.ste_free) * diskblksPerPage
6466N/A+ C.freeSwaptable(st)
6466N/A+ fmt.Printf("tswap %d, fswap: %d\n", tSwap, fSwap)
6466N/A-func fromStatT(s *syscall.Stat_t) (*StatT, error) {
6466N/A-// FromStatT exists only on linux, and loads a system.StatT from a
6466N/A-func FromStatT(s *syscall.Stat_t) (*StatT, error) {
6466N/A-// a system.StatT type pertaining to that file.
6466N/A- s := &syscall.Stat_t{}
6466N/A- if err := syscall.Stat(path, s); err != nil {
6466N/A@@ -15,3 +13,21 @@ func fromStatT(s *syscall.Stat_t) (*StatT, error) {
6466N/A+// FromStatT exists only on linux, and loads a system.StatT from a
6466N/A+func FromStatT(s *syscall.Stat_t) (*StatT, error) {
6466N/A+// a system.StatT type pertaining to that file.
6466N/A+ s := &syscall.Stat_t{}
6466N/A+ if err := syscall.Stat(path, s); err != nil {
6466N/Aindex 0000000..e283201
6466N/A+func fromStatT(s *syscall.Stat_t) (*StatT, error) {
6466N/A+// FromStatT exists only on linux, and loads a system.StatT from a
6466N/A+func FromStatT(s *syscall.Stat_t) (*StatT, error) {
6466N/A+// a system.StatT type pertaining to that file.
6466N/A+ s := &syscall.Stat_t{}
6466N/A+ if err := syscall.Stat(path, s); err != nil {
6466N/A@@ -13,5 +13,5 @@ func fromStatT(s *syscall.Stat_t) (*StatT, error) {
6466N/A- mtim: s.Mtimespec}, nil
6466N/A+type Termios syscall.Termios
6466N/A+ if err := tcget(fd, &oldState.termios); err != 0 {
6466N/A+ newState := oldState.termios
6466N/A+ newState.Iflag &^= (syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | syscall.ICRNL | syscall.IXON | syscall.IXANY)
6466N/A+ newState.Lflag &^= (syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.ISIG | syscall.IEXTEN)
6466N/A+ VMIN is the minimum number of characters that needs to be read in non-canonical mode for it to be returned
6466N/A+ Since VMIN is overloaded with another element in canonical mode when we switch modes it defaults to 4. It
6466N/A+func tcget(fd uintptr, p *Termios) syscall.Errno {
6466N/A+ return err.(syscall.Errno)
6466N/A+func tcset(fd uintptr, p *Termios) syscall.Errno {
6466N/A+ return err.(syscall.Errno)
6466N/Aindex 316c399..f868b70 100644
6466N/A- _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws)))
6466N/A- _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws)))
6466N/A+ ret, err := C.my_ioctl(C.int(fd), C.int(syscall.TIOCGWINSZ), (*C.struct_winsize)(unsafe.Pointer(ws)))
6466N/A+ ret, err := C.my_ioctl(C.int(fd), C.int(syscall.TIOCSWINSZ), (*C.struct_winsize)(unsafe.Pointer(ws)))
6466N/A+ _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws)))
6466N/A+ _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws)))
6466N/Aindex 7630d9a..ec4fb30 100644
6466N/A+func DefaultDaemonNetworkMode() container.NetworkMode {
6466N/A+ return container.NetworkMode("bridge")
6466N/A+ n := container.NetworkMode(network)
6466N/A+ return fmt.Errorf("--net: invalid net mode: invalid container format container:<name|id>")
6466N/A+ if hc.NetworkMode.IsContainer() && (len(hc.PortBindings) > 0 || hc.PublishAllPorts == true) {
6466N/A+func ValidateIsolationLevel(hc *container.HostConfig) error {
6466N/A+ if !hc.Isolation.IsValid() {
6466N/A+ return fmt.Errorf("invalid --isolation: %q. Solaris supports 'default', 'process', or 'hyperv'", hc.Isolation)
6466N/Aindex 28d209b..e3832db 100644
6466N/A@@ -93,6 +93,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
6466N/A flStopSignal = cmd.String([]string{"-stop-signal"}, signal.DefaultStopSignal, fmt.Sprintf("Signal to stop a container, %v by default", signal.DefaultStopSignal))
6466N/A flIsolation = cmd.String([]string{"-isolation"}, "", "Container isolation level")
6466N/A flShmSize = cmd.String([]string{"-shm-size"}, "", "Size of /dev/shm, default value is 64MB")
6466N/A+ flLimitPriv = cmd.String([]string{"-limit-priv"}, "", "Comma separated list of privileges to limit container to")
6466N/A@@ -412,6 +413,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
6466N/Adiff --git a/vendor/src/github.com/Sirupsen/logrus/terminal_solaris.go b/vendor/src/github.com/Sirupsen/logrus/terminal_solaris.go
6466N/Adiff --git a/vendor/src/github.com/docker/engine-api/types/container/config.go b/vendor/src/github.com/docker/engine-api/types/container/config.go
6466N/Adiff --git a/vendor/src/github.com/docker/engine-api/types/container/host_config.go b/vendor/src/github.com/docker/engine-api/types/container/host_config.go
7068N/Adiff --git a/vendor/src/github.com/docker/engine-api/types/types.go b/vendor/src/github.com/docker/engine-api/types/types.go
7068N/Aindex 64c9981..d42395e 100644
6466N/Adiff --git a/vendor/src/github.com/docker/go-connections/sockets/unix_socket.go b/vendor/src/github.com/docker/go-connections/sockets/unix_socket.go
6466N/Aindex c10aced..d162734 100644
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/default_gateway_solaris.go b/vendor/src/github.com/docker/libnetwork/default_gateway_solaris.go
6466N/A+ return nil, types.NotImplementedErrorf("default gateway functionality is not implemented in solaris")
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/bridge.go b/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/bridge.go
6466N/A+ BridgeName = "com.docker.network.bridge.name"
6466N/A+ EnableIPMasquerade = "com.docker.network.bridge.enable_ip_masquerade"
6466N/A+ EnableICC = "com.docker.network.bridge.enable_icc"
6466N/A+ DefaultBindingIP = "com.docker.network.bridge.host_binding_ipv4"
6466N/A+ DefaultBridge = "com.docker.network.bridge.default_bridge"
6466N/A+// endpointConfiguration represents the user specified configuration for the sandbox endpoint
6466N/A+ MacAddress net.HardwareAddr
6466N/A+ PortBindings []types.PortBinding
6466N/A+ ExposedPorts []types.TransportPort
6466N/A+ macAddress net.HardwareAddr
6466N/A+ portMapping []types.PortBinding // Operation port bindings
6466N/A+ portMapper *portmapper.PortMapper
6466N/A+ store datastore.DataStore
6466N/A+func Init(dc driverapi.DriverCallback, config map[string]interface{}) error {
6466N/A+ if err := d.configure(config); err != nil {
6466N/A+ c := driverapi.Capability{
6466N/A+ DataScope: datastore.LocalScope,
6466N/A+ return dc.RegisterDriver(networkType, d, c)
6466N/A+func (d *driver) CreateNetwork(id string, option map[string]interface{}, ipV4Data, ipV6Data []driverapi.IPAMData) error {
6466N/A+ if _, ok := d.networks[id]; ok {
6466N/A+ return types.ForbiddenErrorf("network %s exists", id)
6466N/A+ err = config.processIPAM(id, ipV4Data, ipV6Data)
6466N/A+ if err = d.createNetwork(config); err != nil {
6466N/A+ return d.storeUpdate(config)
6466N/A+ if config.BridgeName == "" {
6466N/A+ config.BridgeName = DefaultBridgeName
6466N/A+ conf := "/etc/firewall/pf.conf"
6466N/A+ return fmt.Errorf("cannot open %s: %v", conf, err)
6466N/A+ scanner := bufio.NewScanner(f)
6466N/A+ for scanner.Scan() {
6466N/A+ l := scanner.Text()
6466N/A+ if strings.Contains(l, "REMOVE THIS LINE") {
6466N/A+ lines = append(lines, fmt.Sprintf("%s\n", l))
6466N/A+ if err = scanner.Err(); err != nil {
6466N/A+ return fmt.Errorf("cannot scan %s: %v", conf, err)
6466N/A+ tmp, err := os.OpenFile(tmpname,
6466N/A+ return fmt.Errorf("cannot open %s: %v", tmpname, err)
6466N/A+ _, err = tmp.WriteString(l)
6466N/A+ return fmt.Errorf("cannot write to %s: %v",
6466N/A+ return fmt.Errorf("cannot sync %s: %v", tmpname, err)
6466N/A+ return fmt.Errorf("cannot rename %s to %s: %v",
6466N/A+ return fmt.Errorf("cannot check firewall state: %v", err)
6466N/A+ state := strings.TrimSpace(string(out))
6466N/A+ return fmt.Errorf("firewall service is in %s state. "+
6466N/A+ return fmt.Errorf("svcadm failed: %v", err)
6466N/A+ return fmt.Errorf("cannot run pfctl: %v", err)
6466N/A+ if strings.Contains(string(out), "anchor \"_auto/docker/*\" all") {
6466N/A+ pfctl_cmd := "(/usr/sbin/pfctl -sr; " +
6466N/A+ "/usr/bin/echo \"anchor \\\"_auto/docker/*\\\"\") |" +
6466N/A+ "/usr/sbin/pfctl -f -"
6466N/A+ return fmt.Errorf("cannot add docker anchor: %v", err)
6466N/A+ return fmt.Errorf("cannot add workaround: %v", err)
7232N/A+ return fmt.Errorf("cannot set ip forwarding: %v", err)
7232N/A+ "/usr/bin/awk '{print $2}'"
7232N/A+ return fmt.Errorf("cannot get default route interface: %v", err)
7232N/A+ route_cmd := "/usr/sbin/ipadm show-addr -p -o addr " + intfc
6466N/A+ return fmt.Errorf("cannot get default route: %v", err)
6466N/A+ defroute := strings.SplitN(string(out), "/", 2)
6466N/A+ if d.defrouteIP == nil {
6466N/A+ if err = d.initFirewall(); err != nil {
6466N/A+ if err = d.initRouting(); err != nil {
6466N/A+ err = d.initStore(option)
6466N/A+ return nil, types.BadRequestErrorf("invalid network id: %s", id)
6466N/A+ if nw, ok := d.networks[id]; ok {
6466N/A+ return nil, types.NotFoundErrorf("network not found: %s", id)
6466N/A+ ls := make([]*bridgeNetwork, 0, len(d.networks))
6466N/A+ for _, nw := range d.networks {
6466N/A+ bridgeName := config.BridgeName
6466N/A+ gwName := fmt.Sprintf("%s_gw0", bridgeName)
6466N/A+ gwIP := config.AddressIPv4.String()
6466N/A+ bindingIP := config.DefaultBindingIP.String()
6466N/A+ ipadm_cmd := "/usr/sbin/ipadm show-addr -p -o addrobj,addr |" +
6466N/A+ "/usr/bin/grep " + bindingIP
6466N/A+ fmt.Println("cannot find binding interface")
6466N/A+ bindingIntf := strings.SplitN(string(out), "/", 2)[0]
6466N/A+ fmt.Println("cannot parse binding interface", string(out))
6466N/A+ config.DefaultBindingIntf = bindingIntf
6466N/A+ fmt.Printf("cannot create etherstub %s\n", bridgeName)
6466N/A+ fmt.Printf("cannot create vnic %s\n", gwName)
6466N/A+ fmt.Printf("cannot ifconfig plumb %s on %s\n",
6466N/A+ pf_anchor := fmt.Sprintf("_auto/docker/%s", tableName)
6466N/A+ err = exec.Command("/usr/sbin/pfctl", "-a", pf_anchor, "-t", tableName, "-T", "add", gwIP).Run()
6466N/A+ fmt.Printf("cannot add bridge network '%s' to PF table\n", bridgeName)
6466N/A+ pf_cmd := fmt.Sprintf(
6466N/A+ "/usr/bin/echo \"pass out on %s from %s:network to any nat-to (%s)\n"+
6466N/A+ "/usr/sbin/pfctl -a _auto/docker/%s -f -",
6466N/A+ fmt.Printf("cannot add pf rule using: %s\n", pf_cmd)
6466N/A+ bridgeName := config.BridgeName
6466N/A+ gwName := fmt.Sprintf("%s_gw0", bridgeName)
6466N/A+ gwIP := config.AddressIPv4.String()
6466N/A+ pf_anchor := fmt.Sprintf("_auto/docker/%s", bridgeName)
6466N/A+ table_anchor := fmt.Sprintf("_auto/docker/%s", tableName)
6466N/A+ fmt.Println("pfctl flush failed")
6466N/A+ fmt.Println("ifconfig unplumb failed")
6466N/A+ fmt.Println("dladm delete-vnic failed")
6466N/A+ fmt.Println("dladm delete-etherstub failed")
6466N/A+ err = exec.Command("/usr/sbin/pfctl", "-a", table_anchor, "-t", tableName, "-T", "delete", gwIP).Run()
6466N/A+ fmt.Printf("cannot remove bridge network '%s' from PF table\n", bridgeName)
6466N/A+ networkList := d.getNetworks()
6466N/A+ if err := nwConfig.Conflicts(config); err != nil {
7068N/A+ if config.DefaultBridge {
7068N/A+ logrus.Infof("Removing stale default bridge network %s (%s)", nwConfig.ID, nwConfig.BridgeName)
7068N/A+ logrus.Warnf("Failed to remove stale default network: %s (%s): %v. Will remove from store.", nwConfig.ID, nwConfig.BridgeName, err)
7068N/A+ d.storeDelete(nwConfig)
7068N/A+ return types.ForbiddenErrorf(
6466N/A+ if config.DefaultBindingIP == nil ||
6466N/A+ portMapper: portmapper.New(),
6466N/A+ network.bridge = bridgeIface
6466N/A+ n, ok := d.networks[nid]
6466N/A+ return types.InternalMaskableErrorf("network %s does not exist", nid)
6466N/A+ delete(d.networks, nid)
6466N/A+ if _, ok := d.networks[nid]; !ok {
6466N/A+ d.networks[nid] = n
6466N/A+ err = driverapi.ErrNoNetwork(nid)
6466N/A+ if len(n.endpoints) != 0 {
6466N/A+ fmt.Println("Deleting bridge network:", nid[:12])
6466N/A+func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo, epOptions map[string]interface{}) error {
6466N/A+ return errors.New("invalid interface info passed")
6466N/A+ n, ok := d.networks[nid]
6466N/A+ return types.NotFoundErrorf("network %s does not exist", nid)
6466N/A+ return driverapi.ErrNoNetwork(nid)
6466N/A+ ep, err := n.getEndpoint(eid)
6466N/A+ return driverapi.ErrEndpointExists(eid)
6466N/A+ n.endpoints[eid] = endpoint
6466N/A+ delete(n.endpoints, eid)
6466N/A+ if ifInfo.MacAddress() == nil {
6466N/A+ fmt.Println("bridge:CreateEndpoint: Unable to set mac address",
6466N/A+ n, ok := d.networks[nid]
6466N/A+ return types.InternalMaskableErrorf("network %s does not exist", nid)
6466N/A+ return driverapi.ErrNoNetwork(nid)
6466N/A+ ep, err := n.getEndpoint(eid)
6466N/A+ delete(n.endpoints, eid)
6466N/A+ // On failure make sure to set back ep in n.endpoints, but only
6466N/A+ if _, ok := n.endpoints[eid]; !ok {
6466N/A+ n.endpoints[eid] = ep
6466N/A+ err = n.releasePorts(ep)
6466N/A+ logrus.Warn(err)
6466N/A+ n, ok := d.networks[nid]
6466N/A+ return nil, types.NotFoundErrorf("network %s does not exist", nid)
6466N/A+ return nil, driverapi.ErrNoNetwork(nid)
6466N/A+ ep, err := n.getEndpoint(eid)
6466N/A+ return nil, driverapi.ErrNoEndpoint(eid)
6466N/A+ if ep.config.ExposedPorts != nil {
6466N/A+ for _, tp := range ep.config.ExposedPorts {
6466N/A+ epc = append(epc, tp.GetCopy())
6466N/A+ m[netlabel.ExposedPorts] = epc
6466N/A+ if ep.portMapping != nil {
6466N/A+ for _, pm := range ep.portMapping {
6466N/A+ pmc = append(pmc, pm.GetCopy())
6466N/A+ m[netlabel.PortMap] = pmc
6466N/A+ if len(ep.macAddress) != 0 {
6466N/A+func (d *driver) Join(nid, eid string, sboxKey string, jinfo driverapi.JoinInfo, options map[string]interface{}) error {
6466N/A+ network, err := d.getNetwork(nid)
6466N/A+ endpoint, err := network.getEndpoint(eid)
6466N/A+ network, err := d.getNetwork(nid)
6466N/A+ return types.InternalMaskableErrorf("%s", err)
6466N/A+ endpoint, err := network.getEndpoint(eid)
6466N/A+// DiscoverNew is a notification for a new discovery event, such as a new node joining a cluster
6466N/A+func (d *driver) DiscoverNew(dType driverapi.DiscoveryType, data interface{}) error {
6466N/A+// DiscoverDelete is a notification for a discovery delete event, such as a node leaving a cluster
6466N/A+func (d *driver) DiscoverDelete(dType driverapi.DiscoveryType, data interface{}) error {
6466N/A+ if c.AddressIPv4 != nil {
6466N/A+ if c.DefaultGatewayIPv4 != nil {
6466N/A+ // If default v6 gw is specified, AddressIPv6 must be specified and gw must belong to AddressIPv6 subnet
6466N/A+// Checks whether this network's configuration for the network with this id conflicts with any of the passed networks
6466N/A+func (c *networkConfiguration) conflictsWithNetworks(id string, others []*bridgeNetwork) error {
6466N/A+ // existing bridge interfaces. Ironically the system chosen name gets stored in the config...
6466N/A+ return types.ForbiddenErrorf("conflicts with network %s (%s) by bridge name", nwID, nwConfig.BridgeName)
6466N/A+ if c.AddressIPv4 != nil {
6466N/A+ return types.ForbiddenErrorf("conflicts with network %s (%s) by ip network", nwID, nwConfig.BridgeName)
6466N/A+ return fmt.Errorf("same configuration")
6466N/A+ return fmt.Errorf("networks have same bridge name")
6466N/A+ return fmt.Errorf("networks have overlapping IPv4")
6466N/A+ return fmt.Errorf("networks have overlapping IPv6")
6466N/A+ c.BridgeName = value
6466N/A+ case netlabel.DriverMTU:
6466N/A+ case netlabel.EnableIPv6:
6466N/A+ return types.BadRequestErrorf("failed to parse %s value: %v (%s)", label, value, errString)
6466N/A+ err = config.fromLabels(opt)
6466N/A+ case options.Generic:
6466N/A+ if opaqueConfig, err = options.GenerateFromModel(opt, config); err == nil {
6466N/A+ err = types.BadRequestErrorf("do not recognize network configuration format: %T", opt)
6466N/A+func parseNetworkOptions(d *driver, id string, option options.Generic) (*networkConfiguration, error) {
6466N/A+ if genData, ok := option[netlabel.GenericData]; ok && genData != nil {
6466N/A+ if val, ok := option[netlabel.EnableIPv6]; ok {
6466N/A+ config.EnableIPv6 = val.(bool)
6466N/A+ if val, ok := option[netlabel.Internal]; ok {
6466N/A+ config.Internal = true
6466N/A+ if err = config.Validate(); err != nil {
6466N/A+ config.BridgeName = "br_" + id[:12] + "_0"
6466N/A+func (c *networkConfiguration) processIPAM(id string, ipamV4Data, ipamV6Data []driverapi.IPAMData) error {
6466N/A+ return types.ForbiddenErrorf("bridge driver doesnt support multiple subnets")
6466N/A+ return types.BadRequestErrorf("bridge network %s requires ipv4 configuration", id)
6466N/A+ c.AddressIPv6 = ipamV6Data[0].Pool
6466N/A+ if ep, ok := n.endpoints[eid]; ok {
6466N/A+func parseEndpointOptions(epOptions map[string]interface{}) (*endpointConfiguration, error) {
6466N/A+ if opt, ok := epOptions[netlabel.MacAddress]; ok {
6466N/A+ if mac, ok := opt.(net.HardwareAddr); ok {
6466N/A+ ec.MacAddress = mac
6466N/A+ if opt, ok := epOptions[netlabel.PortMap]; ok {
6466N/A+ if bs, ok := opt.([]types.PortBinding); ok {
6466N/A+ ec.PortBindings = bs
6466N/A+ if opt, ok := epOptions[netlabel.ExposedPorts]; ok {
6466N/A+ if ports, ok := opt.([]types.TransportPort); ok {
6466N/A+ ec.ExposedPorts = ports
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/bridge_store.go b/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/bridge_store.go
6466N/Aindex 0000000..fbb6ef0
6466N/A+ provider, provOk := option[netlabel.LocalKVProvider]
6466N/A+ provURL, urlOk := option[netlabel.LocalKVProviderURL]
6466N/A+ cfg := &datastore.ScopeCfg{
6466N/A+ Client: datastore.ScopeClientCfg{
6466N/A+ provConfig, confOk := option[netlabel.LocalKVProviderConfig]
6466N/A+ return fmt.Errorf("bridge driver failed to initialize data store: %v", err)
6466N/A+ return d.populateNetworks()
6466N/A+ return fmt.Errorf("failed to get bridge network configurations from store: %v", err)
6466N/A+ if err == datastore.ErrKeyNotFound {
6466N/A+ if err = d.createNetwork(ncfg); err != nil {
6466N/A+ logrus.Warnf("could not create bridge network for id %s bridge name %s while booting up from persistent state", ncfg.ID, ncfg.BridgeName)
6466N/A+func (d *driver) storeUpdate(kvObject datastore.KVObject) error {
6466N/A+ logrus.Warnf("bridge store not initialized. kv object %s is not added to the store", datastore.Key(kvObject.Key()...))
6466N/A+ if err := d.store.PutObjectAtomic(kvObject); err != nil {
6466N/A+ return fmt.Errorf("failed to update bridge store for object type %T: %v", kvObject, err)
6466N/A+func (d *driver) storeDelete(kvObject datastore.KVObject) error {
6466N/A+ logrus.Debugf("bridge store not initialized. kv object %s is not deleted from store", datastore.Key(kvObject.Key()...))
6466N/A+ if err := d.store.DeleteObjectAtomic(kvObject); err != nil {
6466N/A+ if err == datastore.ErrKeyModified {
6466N/A+ return fmt.Errorf("could not update the kvobject to latest when trying to delete: %v", err)
6466N/A+ nMap["BridgeName"] = ncfg.BridgeName
6466N/A+ nMap["EnableIPv6"] = ncfg.EnableIPv6
6466N/A+ nMap["EnableIPMasquerade"] = ncfg.EnableIPMasquerade
6466N/A+ nMap["EnableICC"] = ncfg.EnableICC
6466N/A+ nMap["DefaultBridge"] = ncfg.DefaultBridge
6466N/A+ nMap["DefaultBindingIP"] = ncfg.DefaultBindingIP.String()
6466N/A+ nMap["DefaultGatewayIPv4"] = ncfg.DefaultGatewayIPv4.String()
6466N/A+ nMap["DefaultGatewayIPv6"] = ncfg.DefaultGatewayIPv6.String()
6466N/A+ if ncfg.AddressIPv4 != nil {
6466N/A+ nMap["AddressIPv4"] = ncfg.AddressIPv4.String()
6466N/A+ if ncfg.AddressIPv6 != nil {
6466N/A+ nMap["AddressIPv6"] = ncfg.AddressIPv6.String()
6466N/A+ return json.Marshal(nMap)
6466N/A+ if err = json.Unmarshal(b, &nMap); err != nil {
6466N/A+ return types.InternalErrorf("failed to decode bridge network address IPv4 after json unmarshal: %s", v.(string))
6466N/A+ return types.InternalErrorf("failed to decode bridge network address IPv6 after json unmarshal: %s", v.(string))
6466N/A+ ncfg.DefaultBridge = nMap["DefaultBridge"].(bool)
6466N/A+ ncfg.BridgeName = nMap["BridgeName"].(string)
6466N/A+ ncfg.EnableIPv6 = nMap["EnableIPv6"].(bool)
6466N/A+ ncfg.EnableIPMasquerade = nMap["EnableIPMasquerade"].(bool)
6466N/A+ ncfg.EnableICC = nMap["EnableICC"].(bool)
6466N/A+ b, err := json.Marshal(ncfg)
6466N/A+ return json.Unmarshal(value, ncfg)
6466N/A+ return ncfg.dbIndex
6466N/A+ ncfg.dbIndex = index
6466N/A+ ncfg.dbExists = true
6466N/A+ return ncfg.dbExists
6466N/A+ return ncfg.DefaultBridge
6466N/A+func (ncfg *networkConfiguration) New() datastore.KVObject {
6466N/A+func (ncfg *networkConfiguration) CopyTo(o datastore.KVObject) error {
6466N/A+ return datastore.LocalScope
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/errors.go b/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/errors.go
6466N/A+// ErrInvalidNetworkConfig error is returned when a network is created on a driver without valid config.
6466N/A+// ErrInvalidContainerConfig error is returned when a endpoint create is attempted with an invalid configuration.
6466N/A+// ErrInvalidEndpointConfig error is returned when a endpoint create is attempted with an invalid endpoint configuration.
6466N/A+// ErrNetworkExists error is returned when a network already exists and another network is created.
6466N/A+// ErrInvalidGateway is returned when the user provided default gateway (v4/v6) is not not valid.
6466N/A+// ErrInvalidContainerSubnet is returned when the container subnet (FixedCIDR) is not valid.
6466N/A+ return fmt.Sprintf("invalid MTU number: %d", int(eim))
6466N/A+// ErrInvalidPort is returned when the container or host port specified in the port binding is not valid.
6466N/A+ return fmt.Sprintf("invalid transport port: %s", string(ip))
6466N/A+ return fmt.Sprintf("unsupported address type: %s", string(uat))
6466N/A+// ErrInvalidAddressBinding is returned when the host address specified in the port binding is not valid.
6466N/A+ return fmt.Sprintf("invalid host address in port binding: %s", string(iab))
6466N/A+ return fmt.Sprintf("network %s has active endpoint", string(aee))
6466N/A+ return fmt.Sprintf("invalid network id %s", string(inie))
6466N/A+ return fmt.Sprintf("invalid endpoint id: %s", string(ieie))
6466N/A+ return fmt.Sprintf("invalid sanbox id: %s", string(isie))
6466N/A+ return fmt.Sprintf("endpoint not found: %s", string(enfe))
6466N/A+ return fmt.Sprintf("bridge device with non default name %s must be created manually", string(ndbee))
6466N/A+ return fmt.Sprintf("bridge device with non default name %s must have a valid IP address", string(ndbee))
6466N/A+ return fmt.Sprintf("setup FixedCIDRv4 failed for subnet %s in %s: %v", fcv4.Subnet, fcv4.Net, fcv4.Err)
6466N/A+ return fmt.Sprintf("setup FixedCIDRv6 failed for subnet %s in %s: %v", fcv6.Net, fcv6.Net, fcv6.Err)
6466N/A+ return fmt.Sprintf("unexpected request to set IP tables for interface: %s", string(name))
6466N/A+ return fmt.Sprintf("Invalid IPTables action '%s'", string(action))
6466N/A+ return fmt.Sprintf("can't find an address range for interface %q", string(name))
6466N/A+// IPv4AddrNoMatchError is returned when the bridge's IPv4 address does not match configured.
6466N/A+ return fmt.Sprintf("bridge IPv4 (%s) does not match requested configuration %s", ipv4.IP, ipv4.CfgIP)
6466N/A+// IPv6AddrNoMatchError is returned when the bridge's IPv6 address does not match configured.
6466N/A+ return fmt.Sprintf("bridge IPv6 addresses do not match the expected bridge configuration %s", (*net.IPNet)(ipv6).String())
6466N/A+// InvalidLinkIPAddrError is returned when a link is configured to a container with an invalid ip address
6466N/A+ return fmt.Sprintf("Cannot link to a container with Invalid IP Address '%s'", string(address))
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/port_mapping.go b/vendor/src/github.com/docker/libnetwork/drivers/solaris/bridge/port_mapping.go
7368N/Aindex 0000000..a2e0599
7068N/A+func addPFRules(epid, bindIntf string, bs []types.PortBinding,
6466N/A+ fname := "/var/lib/docker/network/files/pf." + id
6466N/A+ f, err := os.OpenFile(fname,
6466N/A+ logrus.Warnf("cannot open temp pf file")
7368N/A+ gwIPaddr := nwAddr.String()
7368N/A+ _, gwNetwork, err := net.ParseCIDR(gwIPaddr)
7368N/A+ logrus.Warnf("ParseCIDR error.")
6466N/A+ r := fmt.Sprintf(
6466N/A+ _, err = f.WriteString(r)
6466N/A+ logrus.Warnf("cannot write to %s: %v", fname, err)
7068N/A+ r = fmt.Sprintf(
7068N/A+ _, err = f.WriteString(r)
7068N/A+ logrus.Warnf("cannot write to %s: %v", fname, err)
7068N/A+ r = fmt.Sprintf(
7068N/A+ _, err = f.WriteString(r)
7068N/A+ logrus.Warnf("cannot write to %s: %v", fname, err)
7368N/A+ r = fmt.Sprintf(
7368N/A+ _, err = f.WriteString(r)
7368N/A+ logrus.Warnf("cannot write to %s: %v", fname, err)
7368N/A+ r = fmt.Sprintf(
7368N/A+ _, err = f.WriteString(r)
7368N/A+ logrus.Warnf("cannot write to %s: %v", fname, err)
6466N/A+ logrus.Warnf("pfctl -f failed: %v", err)
6466N/A+ logrus.Warnf("pfctl -F failed: %v", err)
7368N/A+func (n *bridgeNetwork) allocatePorts(epc *endpointConfiguration, ep *bridgeEndpoint, bindIntf string, reqDefBindIP net.IP, gwIntf string, nwAddr *net.IPNet) ([]types.PortBinding, error) {
6466N/A+ bindIntf, ep.addr.IP, defHostIP)
6466N/A+func (n *bridgeNetwork) allocatePortsInternal(bindings []types.PortBinding, bindIntf string, containerIP, defHostIP net.IP) ([]types.PortBinding, error) {
6466N/A+ bs := make([]types.PortBinding, 0, len(bindings))
6466N/A+ if err := n.allocatePort(&b, containerIP, defHostIP);
6466N/A+ if cuErr := n.releasePortsInternal(bs); cuErr != nil {
6466N/A+ logrus.Warnf("Upon allocation failure " +
6466N/A+func (n *bridgeNetwork) allocatePort(bnd *types.PortBinding, containerIP, defHostIP net.IP) error {
6466N/A+ if len(bnd.HostIP) == 0 {
6466N/A+ bnd.HostIP = defHostIP
6466N/A+ if bnd.HostPortEnd == 0 {
6466N/A+ container, err := bnd.ContainerAddr()
6466N/A+ if bnd.HostPort != 0 {
6466N/A+ logrus.Warnf("Failed to allocate and map port: %s, retry: %d",
6466N/A+ case *net.TCPAddr:
6466N/A+ case *net.UDPAddr:
6466N/A+ return ErrUnsupportedAddressType(fmt.Sprintf("%T", netAddr))
6466N/A+func (n *bridgeNetwork) releasePortsInternal(bindings []types.PortBinding) error{
6466N/A+ var errorBuf bytes.Buffer
6466N/A+ if err := n.releasePort(m); err != nil {
6466N/A+ if errorBuf.Len() != 0 {
6466N/A+func (n *bridgeNetwork) releasePort(bnd types.PortBinding) error {
6466N/A+ host, err := bnd.HostAddr()
6466N/A+ return n.portMapper.Unmap(host)
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/drivers_solaris.go b/vendor/src/github.com/docker/libnetwork/drivers_solaris.go
6466N/Aindex 0000000..ba5d6a9
6466N/A+ {bridge.Init, "bridge"},
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/ipamutils/utils_solaris.go b/vendor/src/github.com/docker/libnetwork/ipamutils/utils_solaris.go
6466N/A+ fmt.Println("ipadm show-addr failed")
6466N/A+ alist := strings.Fields(string(out))
6466N/A+ linkandaddr := strings.SplitN(a, ":", 2)
6466N/A+ fmt.Println("invalid ipadm output", a)
6466N/A+ gw := fmt.Sprintf("%s_gw0", name)
6466N/A+ link := strings.Split(linkandaddr[0], "/")[0]
6466N/A+ _, ipnet, err := net.ParseCIDR(addr)
6466N/A+ fmt.Println("cannot parse addr", addr)
6466N/A+ fmt.Println("ipadm show-addr failed")
6466N/A+ ipaddrs := strings.Fields(string(out))
6466N/A+ _, ipnet, err := net.ParseCIDR(ip)
6466N/A+ fmt.Println("ParseCIDR failed:", ip)
6466N/A+ if netutils.NetworkOverlaps(avail, ipnet) {
6466N/A+ return nil, fmt.Errorf("no available network")
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/network.go b/vendor/src/github.com/docker/libnetwork/network.go
6466N/A n, err := c.getNetworkFromStore(id)
6466N/A return fmt.Errorf("failed deleting network: %v", err)
6466N/A if _, ok := err.(types.ForbiddenError); ok {
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/osl/interface_solaris.go b/vendor/src/github.com/docker/libnetwork/osl/interface_solaris.go
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/osl/namespace_solaris.go b/vendor/src/github.com/docker/libnetwork/osl/namespace_solaris.go
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/osl/namespace_unsupported.go b/vendor/src/github.com/docker/libnetwork/osl/namespace_unsupported.go
6466N/Aindex dbd8d9d..f85c558 100644
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/osl/neigh_solaris.go b/vendor/src/github.com/docker/libnetwork/osl/neigh_solaris.go
6466N/Aindex 0000000..d6e8910
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/osl/sandbox_unsupported.go b/vendor/src/github.com/docker/libnetwork/osl/sandbox_unsupported.go
6466N/Aindex 3bc6c38..dcffc38 100644
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portallocator/portallocator.go b/vendor/src/github.com/docker/libnetwork/portallocator/portallocator.go
6466N/Aindex 240e94f..b7f790b 100644
6466N/A- const portRangeKernelParam = "/proc/sys/net/ipv4/ip_local_port_range"
6466N/A- portRangeFallback := fmt.Sprintf("using fallback port range %d-%d", DefaultPortRangeStart, DefaultPortRangeEnd)
6466N/A- return 0, 0, fmt.Errorf("port allocator - %s due to error: %v", portRangeFallback, err)
6466N/A- defer file.Close()
6466N/A- err = fmt.Errorf("unexpected count of parsed numbers (%d)", n)
6466N/A- return 0, 0, fmt.Errorf("port allocator - failed to parse system ephemeral port range from %s - %s: %v", portRangeKernelParam, portRangeFallback, err)
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portallocator/portallocator_linux.go b/vendor/src/github.com/docker/libnetwork/portallocator/portallocator_linux.go
6466N/A+ const portRangeKernelParam = "/proc/sys/net/ipv4/ip_local_port_range"
6466N/A+ portRangeFallback := fmt.Sprintf("using fallback port range %d-%d", DefaultPortRangeStart, DefaultPortRangeEnd)
6466N/A+ return 0, 0, fmt.Errorf("port allocator - %s due to error: %v", portRangeFallback, err)
6466N/A+ defer file.Close()
6466N/A+ err = fmt.Errorf("unexpected count of parsed numbers (%d)", n)
6466N/A+ return 0, 0, fmt.Errorf("port allocator - failed to parse system ephemeral port range from %s - %s: %v", portRangeKernelParam, portRangeFallback, err)
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portallocator/portallocator_solaris.go b/vendor/src/github.com/docker/libnetwork/portallocator/portallocator_solaris.go
6466N/Aindex 0000000..ccc20b1
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portmapper/mapper.go b/vendor/src/github.com/docker/libnetwork/portmapper/mapper.go
6466N/A- ErrUnknownBackendAddressType = errors.New("unknown container address type not supported")
6466N/A- ErrPortMappedForIP = errors.New("port is already mapped to ip")
6466N/A- ErrPortNotMapped = errors.New("port is not mapped")
6466N/A- chain *iptables.ChainInfo
6466N/A- lock sync.Mutex
6466N/A- Allocator *portallocator.PortAllocator
6466N/A- return NewWithPortAllocator(portallocator.Get())
6466N/A-// NewWithPortAllocator returns a new instance of PortMapper which will use the specified PortAllocator
6466N/A-func NewWithPortAllocator(allocator *portallocator.PortAllocator) *PortMapper {
6466N/A-func (pm *PortMapper) SetIptablesChain(c *iptables.ChainInfo, bridgeName string) {
6466N/A- pm.bridgeName = bridgeName
6466N/A-// Map maps the specified container transport address to the host's network address and transport port
6466N/A-func (pm *PortMapper) Map(container net.Addr, hostIP net.IP, hostPort int, useProxy bool) (host net.Addr, err error) {
6466N/A- return pm.MapRange(container, hostIP, hostPort, hostPort, useProxy)
6466N/A-// MapRange maps the specified container transport address to the host's network address and transport port range
6466N/A-func (pm *PortMapper) MapRange(container net.Addr, hostIP net.IP, hostPortStart, hostPortEnd int, useProxy bool) (host net.Addr, err error) {
6466N/A- defer pm.lock.Unlock()
6466N/A- case *net.TCPAddr:
6466N/A- if allocatedHostPort, err = pm.Allocator.RequestPortInRange(hostIP, proto, hostPortStart, hostPortEnd); err != nil {
6466N/A- host: &net.TCPAddr{IP: hostIP, Port: allocatedHostPort},
6466N/A- m.userlandProxy = newProxy(proto, hostIP, allocatedHostPort, container.(*net.TCPAddr).IP, container.(*net.TCPAddr).Port)
6466N/A- m.userlandProxy = newDummyProxy(proto, hostIP, allocatedHostPort)
6466N/A- case *net.UDPAddr:
6466N/A- if allocatedHostPort, err = pm.Allocator.RequestPortInRange(hostIP, proto, hostPortStart, hostPortEnd); err != nil {
6466N/A- host: &net.UDPAddr{IP: hostIP, Port: allocatedHostPort},
6466N/A- m.userlandProxy = newProxy(proto, hostIP, allocatedHostPort, container.(*net.UDPAddr).IP, container.(*net.UDPAddr).Port)
6466N/A- m.userlandProxy = newDummyProxy(proto, hostIP, allocatedHostPort)
6466N/A- pm.Allocator.ReleasePort(hostIP, proto, allocatedHostPort)
6466N/A- if _, exists := pm.currentMappings[key]; exists {
6466N/A- containerIP, containerPort := getIPAndPort(m.container)
6466N/A- if err := pm.forward(iptables.Append, m.proto, hostIP, allocatedHostPort, containerIP.String(), containerPort); err != nil {
6466N/A- pm.forward(iptables.Delete, m.proto, hostIP, allocatedHostPort, containerIP.String(), containerPort)
6466N/A- if err := m.userlandProxy.Start(); err != nil {
6466N/A- return nil, fmt.Errorf("Error during port allocation cleanup: %v", err)
6466N/A- pm.currentMappings[key] = m
6466N/A- defer pm.lock.Unlock()
6466N/A- data, exists := pm.currentMappings[key]
6466N/A- if data.userlandProxy != nil {
6466N/A- delete(pm.currentMappings, key)
6466N/A- containerIP, containerPort := getIPAndPort(data.container)
6466N/A- if err := pm.forward(iptables.Delete, data.proto, hostIP, hostPort, containerIP.String(), containerPort); err != nil {
6466N/A- logrus.Errorf("Error on iptables delete: %s", err)
6466N/A- case *net.TCPAddr:
6466N/A- case *net.UDPAddr:
6466N/A- defer pm.lock.Unlock()
6466N/A- logrus.Debugln("Re-applying all port mappings.")
6466N/A- for _, data := range pm.currentMappings {
6466N/A- containerIP, containerPort := getIPAndPort(data.container)
6466N/A- if err := pm.forward(iptables.Append, data.proto, hostIP, hostPort, containerIP.String(), containerPort); err != nil {
6466N/A- logrus.Errorf("Error on iptables add: %s", err)
6466N/A- case *net.TCPAddr:
6466N/A- case *net.UDPAddr:
6466N/A- case *net.TCPAddr:
6466N/A- case *net.UDPAddr:
6466N/A-func (pm *PortMapper) forward(action iptables.Action, proto string, sourceIP net.IP, sourcePort int, containerIP string, containerPort int) error {
6466N/A- return pm.chain.Forward(action, sourceIP, sourcePort, proto, containerIP, containerPort, pm.bridgeName)
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portmapper/mapper_linux.go b/vendor/src/github.com/docker/libnetwork/portmapper/mapper_linux.go
6466N/Aindex 0000000..d125fa8
6466N/A+ ErrUnknownBackendAddressType = errors.New("unknown container address type not supported")
6466N/A+ ErrPortMappedForIP = errors.New("port is already mapped to ip")
6466N/A+ ErrPortNotMapped = errors.New("port is not mapped")
6466N/A+ chain *iptables.ChainInfo
6466N/A+ lock sync.Mutex
6466N/A+ Allocator *portallocator.PortAllocator
6466N/A+ return NewWithPortAllocator(portallocator.Get())
6466N/A+// NewWithPortAllocator returns a new instance of PortMapper which will use the specified PortAllocator
6466N/A+func NewWithPortAllocator(allocator *portallocator.PortAllocator) *PortMapper {
6466N/A+func (pm *PortMapper) SetIptablesChain(c *iptables.ChainInfo, bridgeName string) {
6466N/A+ pm.bridgeName = bridgeName
6466N/A+// Map maps the specified container transport address to the host's network address and transport port
6466N/A+func (pm *PortMapper) Map(container net.Addr, hostIP net.IP, hostPort int, useProxy bool) (host net.Addr, err error) {
6466N/A+ return pm.MapRange(container, hostIP, hostPort, hostPort, useProxy)
6466N/A+// MapRange maps the specified container transport address to the host's network address and transport port range
6466N/A+func (pm *PortMapper) MapRange(container net.Addr, hostIP net.IP, hostPortStart, hostPortEnd int, useProxy bool) (host net.Addr, err error) {
6466N/A+ defer pm.lock.Unlock()
6466N/A+ case *net.TCPAddr:
6466N/A+ if allocatedHostPort, err = pm.Allocator.RequestPortInRange(hostIP, proto, hostPortStart, hostPortEnd); err != nil {
6466N/A+ host: &net.TCPAddr{IP: hostIP, Port: allocatedHostPort},
6466N/A+ m.userlandProxy = newProxy(proto, hostIP, allocatedHostPort, container.(*net.TCPAddr).IP, container.(*net.TCPAddr).Port)
6466N/A+ m.userlandProxy = newDummyProxy(proto, hostIP, allocatedHostPort)
6466N/A+ case *net.UDPAddr:
6466N/A+ if allocatedHostPort, err = pm.Allocator.RequestPortInRange(hostIP, proto, hostPortStart, hostPortEnd); err != nil {
6466N/A+ host: &net.UDPAddr{IP: hostIP, Port: allocatedHostPort},
6466N/A+ m.userlandProxy = newProxy(proto, hostIP, allocatedHostPort, container.(*net.UDPAddr).IP, container.(*net.UDPAddr).Port)
6466N/A+ m.userlandProxy = newDummyProxy(proto, hostIP, allocatedHostPort)
6466N/A+ pm.Allocator.ReleasePort(hostIP, proto, allocatedHostPort)
6466N/A+ if _, exists := pm.currentMappings[key]; exists {
6466N/A+ containerIP, containerPort := getIPAndPort(m.container)
6466N/A+ if err := pm.forward(iptables.Append, m.proto, hostIP, allocatedHostPort, containerIP.String(), containerPort); err != nil {
6466N/A+ pm.forward(iptables.Delete, m.proto, hostIP, allocatedHostPort, containerIP.String(), containerPort)
6466N/A+ if err := m.userlandProxy.Start(); err != nil {
6466N/A+ return nil, fmt.Errorf("Error during port allocation cleanup: %v", err)
6466N/A+ pm.currentMappings[key] = m
6466N/A+ defer pm.lock.Unlock()
6466N/A+ data, exists := pm.currentMappings[key]
6466N/A+ if data.userlandProxy != nil {
6466N/A+ delete(pm.currentMappings, key)
6466N/A+ containerIP, containerPort := getIPAndPort(data.container)
6466N/A+ if err := pm.forward(iptables.Delete, data.proto, hostIP, hostPort, containerIP.String(), containerPort); err != nil {
6466N/A+ logrus.Errorf("Error on iptables delete: %s", err)
6466N/A+ case *net.TCPAddr:
6466N/A+ case *net.UDPAddr:
6466N/A+ defer pm.lock.Unlock()
6466N/A+ logrus.Debugln("Re-applying all port mappings.")
6466N/A+ for _, data := range pm.currentMappings {
6466N/A+ containerIP, containerPort := getIPAndPort(data.container)
6466N/A+ if err := pm.forward(iptables.Append, data.proto, hostIP, hostPort, containerIP.String(), containerPort); err != nil {
6466N/A+ logrus.Errorf("Error on iptables add: %s", err)
6466N/A+ case *net.TCPAddr:
6466N/A+ case *net.UDPAddr:
6466N/A+ case *net.TCPAddr:
6466N/A+ case *net.UDPAddr:
6466N/A+func (pm *PortMapper) forward(action iptables.Action, proto string, sourceIP net.IP, sourcePort int, containerIP string, containerPort int) error {
6466N/A+ return pm.chain.Forward(action, sourceIP, sourcePort, proto, containerIP, containerPort, pm.bridgeName)
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portmapper/mapper_solaris.go b/vendor/src/github.com/docker/libnetwork/portmapper/mapper_solaris.go
6466N/A+ ErrUnknownBackendAddressType = errors.New("unknown container address type not supported")
6466N/A+ ErrPortMappedForIP = errors.New("port is already mapped to ip")
6466N/A+ ErrPortNotMapped = errors.New("port is not mapped")
6466N/A+ Allocator *portallocator.PortAllocator
6466N/A+ lock sync.Mutex
6466N/A+ return NewWithPortAllocator(portallocator.Get())
6466N/A+// NewWithPortAllocator returns a new instance of PortMapper which will use the specified PortAllocator
6466N/A+func NewWithPortAllocator(allocator *portallocator.PortAllocator) *PortMapper {
6466N/A+// Map maps the specified container transport address to the host's network address and transport port
6466N/A+func (pm *PortMapper) Map(container net.Addr, hostIP net.IP, hostPort int) (host net.Addr, err error) {
6466N/A+ return pm.MapRange(container, hostIP, hostPort, hostPort)
6466N/A+// MapRange maps the specified container transport address to the host's network address and transport port range
6466N/A+func (pm *PortMapper) MapRange(container net.Addr, hostIP net.IP, hostPortStart, hostPortEnd int) (host net.Addr, err error) {
6466N/A+ defer pm.lock.Unlock()
6466N/A+ case *net.TCPAddr:
6466N/A+ if allocatedHostPort, err = pm.Allocator.RequestPortInRange(hostIP, proto,
6466N/A+ host: &net.TCPAddr{IP: hostIP, Port: allocatedHostPort},
6466N/A+ case *net.UDPAddr:
6466N/A+ if allocatedHostPort, err = pm.Allocator.RequestPortInRange(hostIP, proto,
6466N/A+ host: &net.UDPAddr{IP: hostIP, Port: allocatedHostPort},
6466N/A+ pm.Allocator.ReleasePort(hostIP, proto, allocatedHostPort)
6466N/A+ if _, exists := pm.currentMappings[key]; exists {
6466N/A+ pm.currentMappings[key] = m
6466N/A+ defer pm.lock.Unlock()
6466N/A+ _, exists := pm.currentMappings[key]
6466N/A+ delete(pm.currentMappings, key)
6466N/A+ case *net.TCPAddr:
6466N/A+ case *net.UDPAddr:
6466N/A+ case *net.TCPAddr:
6466N/A+ case *net.UDPAddr:
6466N/A+ case *net.TCPAddr:
6466N/A+ case *net.UDPAddr:
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portmapper/mock_proxy.go b/vendor/src/github.com/docker/libnetwork/portmapper/mock_proxy.go
6466N/A-func newMockProxyCommand(proto string, hostIP net.IP, hostPort int, containerIP net.IP, containerPort int) userlandProxy {
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portmapper/mock_proxy_linux.go b/vendor/src/github.com/docker/libnetwork/portmapper/mock_proxy_linux.go
6466N/A+func newMockProxyCommand(proto string, hostIP net.IP, hostPort int, containerIP net.IP, containerPort int) userlandProxy {
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portmapper/proxy.go b/vendor/src/github.com/docker/libnetwork/portmapper/proxy.go
6466N/A- reexec.Register(userlandProxyCommandName, execProxy)
6466N/A- f := os.NewFile(3, "signal-parent")
6466N/A- p, err := proxy.NewProxy(host, container)
6466N/A- fmt.Fprintf(f, "1\n%s", err)
6466N/A- fmt.Fprint(f, "0\n")
6466N/A- proto = flag.String("proto", "tcp", "proxy protocol")
6466N/A- hostIP = flag.String("host-ip", "", "host ip")
6466N/A- containerIP = flag.String("container-ip", "", "container ip")
6466N/A- log.Fatalf("unsupported protocol %s", *proto)
6466N/A-func handleStopSignals(p proxy.Proxy) {
6466N/A-func newProxyCommand(proto string, hostIP net.IP, hostPort int, containerIP net.IP, containerPort int) userlandProxy {
6466N/A- "-host-ip", hostIP.String(),
6466N/A- "-host-port", strconv.Itoa(hostPort),
6466N/A- "-container-ip", containerIP.String(),
6466N/A- "-container-port", strconv.Itoa(containerPort),
6466N/A- Path: reexec.Self(),
6466N/A- SysProcAttr: &syscall.SysProcAttr{
6466N/A- Pdeathsig: syscall.SIGTERM, // send a sigterm to the proxy if the daemon process dies
6466N/A- if err := p.cmd.Start(); err != nil {
6466N/A- errStr, err := ioutil.ReadAll(r)
6466N/A- errchan <- fmt.Errorf("Error reading exit status from userland proxy: %v", err)
6466N/A- errchan <- fmt.Errorf("Error starting userland proxy: %s", errStr)
6466N/A- return fmt.Errorf("Timed out proxy starting the userland proxy")
6466N/A- if p.cmd.Process != nil {
6466N/A- return p.cmd.Wait()
6466N/A-// iptables rules and not net.Listen
6466N/A- addr := &net.TCPAddr{IP: hostIP, Port: hostPort}
6466N/A- addr := &net.UDPAddr{IP: hostIP, Port: hostPort}
6466N/A- case *net.TCPAddr:
6466N/A- l, err := net.ListenTCP("tcp", addr)
6466N/A- p.listener = l
6466N/A- case *net.UDPAddr:
6466N/A- l, err := net.ListenUDP("udp", addr)
6466N/A- p.listener = l
6466N/A- if p.listener != nil {
6466N/A- return p.listener.Close()
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/portmapper/proxy_linux.go b/vendor/src/github.com/docker/libnetwork/portmapper/proxy_linux.go
6466N/Aindex 0000000..ddde274
6466N/A+ reexec.Register(userlandProxyCommandName, execProxy)
6466N/A+ f := os.NewFile(3, "signal-parent")
6466N/A+ p, err := proxy.NewProxy(host, container)
6466N/A+ fmt.Fprintf(f, "1\n%s", err)
6466N/A+ fmt.Fprint(f, "0\n")
6466N/A+ proto = flag.String("proto", "tcp", "proxy protocol")
6466N/A+ hostIP = flag.String("host-ip", "", "host ip")
6466N/A+ containerIP = flag.String("container-ip", "", "container ip")
6466N/A+ log.Fatalf("unsupported protocol %s", *proto)
6466N/A+func handleStopSignals(p proxy.Proxy) {
6466N/A+func newProxyCommand(proto string, hostIP net.IP, hostPort int, containerIP net.IP, containerPort int) userlandProxy {
6466N/A+ "-host-ip", hostIP.String(),
6466N/A+ "-host-port", strconv.Itoa(hostPort),
6466N/A+ "-container-ip", containerIP.String(),
6466N/A+ "-container-port", strconv.Itoa(containerPort),
6466N/A+ Path: reexec.Self(),
6466N/A+ SysProcAttr: &syscall.SysProcAttr{
6466N/A+ Pdeathsig: syscall.SIGTERM, // send a sigterm to the proxy if the daemon process dies
6466N/A+ if err := p.cmd.Start(); err != nil {
6466N/A+ errStr, err := ioutil.ReadAll(r)
6466N/A+ errchan <- fmt.Errorf("Error reading exit status from userland proxy: %v", err)
6466N/A+ errchan <- fmt.Errorf("Error starting userland proxy: %s", errStr)
6466N/A+ return fmt.Errorf("Timed out proxy starting the userland proxy")
6466N/A+ if p.cmd.Process != nil {
6466N/A+ return p.cmd.Wait()
6466N/A+// iptables rules and not net.Listen
6466N/A+ addr := &net.TCPAddr{IP: hostIP, Port: hostPort}
6466N/A+ addr := &net.UDPAddr{IP: hostIP, Port: hostPort}
6466N/A+ case *net.TCPAddr:
6466N/A+ l, err := net.ListenTCP("tcp", addr)
6466N/A+ p.listener = l
6466N/A+ case *net.UDPAddr:
6466N/A+ l, err := net.ListenUDP("udp", addr)
6466N/A+ p.listener = l
6466N/A+ if p.listener != nil {
6466N/A+ return p.listener.Close()
7068N/Adiff --git a/vendor/src/github.com/docker/libnetwork/sandbox.go b/vendor/src/github.com/docker/libnetwork/sandbox.go
7068N/A func (sb *sandbox) Statistics() (map[string]*types.InterfaceStatistics, error) {
7068N/A m := make(map[string]*types.InterfaceStatistics)
7068N/A- for _, i := range sb.osSbox.Info().Interfaces() {
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/sandbox_externalkey_solaris.go b/vendor/src/github.com/docker/libnetwork/sandbox_externalkey_solaris.go
6466N/A+// It expects 3 args { [0] = "libnetwork-setkey", [1] = <container-id>, [2] = <controller-id> }
6466N/A+// It also expects libcontainer.State as a json string in <stdin>
6466N/A+// Refer to https://github.com/opencontainers/runc/pull/160/ for more information
6466N/A+ return types.NotImplementedErrorf("SetExternalKey isn't supported on non linux systems")
6466N/A+ return types.NotImplementedErrorf("sendKey isn't supported on non linux systems")
6466N/A+ return types.NotImplementedErrorf("processReturn isn't supported on non linux systems")
6466N/A+func (c *controller) acceptClientConnections(sock string, l net.Listener) {
6466N/A+ return types.NotImplementedErrorf("processExternalKey isn't supported on non linux systems")
6466N/Adiff --git a/vendor/src/github.com/docker/libnetwork/sandbox_externalkey_unix.go b/vendor/src/github.com/docker/libnetwork/sandbox_externalkey_unix.go
6466N/Adiff --git a/vendor/src/github.com/godbus/dbus/transport_unix.go b/vendor/src/github.com/godbus/dbus/transport_unix.go
6466N/Aindex 3fafeab..a1d00cb 100644
6466N/Aindex 5b856e8..ae74671 100644
6466N/A- _, _, errno := syscall.Syscall(
6466N/A- uintptr(unsafe.Pointer(ws)),
6466N/A- return syscall.Errno(errno)
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/utils.go b/vendor/src/github.com/mistifyio/go-zfs/utils.go
6466N/A- setString(&ds.Compression, val)
6466N/A- setString(&ds.Mountpoint, val)
6466N/A- err = setUint(&ds.Volsize, val)
6466N/A- err = setUint(&ds.Written, val)
6466N/A- err = setUint(&ds.Logicalused, val)
6466N/A var referenceCountRegex = regexp.MustCompile("\\(([+-]\\d+?)\\)")
6466N/A matches := referenceCountRegex.FindStringSubmatch(field)
6466N/A return 0, fmt.Errorf("Regexp does not match")
6466N/A return nil, fmt.Errorf("Empty line passed")
6466N/A //M / /testpool/bar/hello.txt (+1)
6466N/A- if err := ds.parseLine(line); err != nil {
6466N/A- err = setUint(&z.Allocated, val)
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/utils_notsolaris.go b/vendor/src/github.com/mistifyio/go-zfs/utils_notsolaris.go
6466N/Aindex 0000000..de3b265
6466N/A+ setString(&ds.Compression, val)
6466N/A+ setString(&ds.Mountpoint, val)
6466N/A+ err = setUint(&ds.Volsize, val)
6466N/A+ err = setUint(&ds.Written, val)
6466N/A+ err = setUint(&ds.Logicalused, val)
6466N/A+ if err := ds.parseLine(line); err != nil {
6466N/A+ fmt.Printf("The input to parseline is: %+v\n", line)
6466N/A+ err = setUint(&z.Allocated, &i)
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/utils_solaris.go b/vendor/src/github.com/mistifyio/go-zfs/utils_solaris.go
6466N/A+ elapsed := time.Since(start)
6466N/A+ fmt.Printf("%s took %s time\n", name, elapsed)
6466N/A+ setString(&ds.Compression, line[5])
6466N/A+ setString(&ds.Mountpoint, line[4])
6466N/A+ setString(&ds.Volsize, line[7])
6466N/A+ if err := ds.parseLine(line); err != nil {
6466N/A+ setString(&z.Allocated, val)
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/zfs.go b/vendor/src/github.com/mistifyio/go-zfs/zfs.go
6466N/A- if err := ds.parseLine(line); err != nil {
6466N/A return nil, errors.New("can only clone snapshots")
6466N/A@@ -176,6 +144,7 @@ func (d *Dataset) Clone(dest string, properties map[string]string) (*Dataset, er
6466N/A // SendSnapshot sends a ZFS stream of a snapshot to the input io.Writer.
6466N/A return errors.New("can only send snapshots")
6466N/A func CreateVolume(name string, size uint64, properties map[string]string) (*Dataset, error) {
6466N/A@@ -222,6 +193,7 @@ func CreateVolume(name string, size uint64, properties map[string]string) (*Data
6466N/A@@ -296,6 +269,7 @@ func CreateFilesystem(name string, properties map[string]string) (*Dataset, erro
6466N/A@@ -316,6 +290,7 @@ func (d *Dataset) Snapshot(name string, recursive bool) (*Dataset, error) {
6466N/A return errors.New("can only rollback snapshots")
6466N/A- args = append(args, strconv.FormatUint(depth, 10))
6466N/A- if err := ds.parseLine(line); err != nil {
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/zfs_notsolaris.go b/vendor/src/github.com/mistifyio/go-zfs/zfs_notsolaris.go
6466N/A+ args = append(args, strconv.FormatUint(depth, 10))
6466N/A+ if err := ds.parseLine(line); err != nil {
6466N/A+ if err := ds.parseLine(line); err != nil {
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/zfs_solaris.go b/vendor/src/github.com/mistifyio/go-zfs/zfs_solaris.go
6466N/Aindex 0000000..f5db280
6466N/A+ args = append(args, strconv.FormatUint(depth, 10))
6466N/A+ if err := ds.parseLine(line); err != nil {
6466N/A+ if err := ds.parseLine(line); err != nil {
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/zpool.go b/vendor/src/github.com/mistifyio/go-zfs/zpool.go
6466N/A- if err := z.parseLine(line); err != nil {
6466N/A // found here: https://www.freebsd.org/cgi/man.cgi?zfs(8).
6466N/A func CreateZpool(name string, properties map[string]string, args ...string) (*Zpool, error) {
6466N/A@@ -80,12 +55,14 @@ func CreateZpool(name string, properties map[string]string, args ...string) (*Zp
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/zpool_notsolaris.go b/vendor/src/github.com/mistifyio/go-zfs/zpool_notsolaris.go
6466N/A+ if err := z.parseLine(line); err != nil {
6466N/Adiff --git a/vendor/src/github.com/mistifyio/go-zfs/zpool_solaris.go b/vendor/src/github.com/mistifyio/go-zfs/zpool_solaris.go
6466N/A+ if err := z.parseLine(line); err != nil {
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/configs/cgroup_solaris.go b/vendor/src/github.com/opencontainers/runc/libcontainer/configs/cgroup_solaris.go
6466N/Aindex 0000000..ee56d98
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/configs/cgroup_unsupported.go b/vendor/src/github.com/opencontainers/runc/libcontainer/configs/cgroup_unsupported.go
6466N/Aindex 95e2830..bd82e0f 100644
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/configs/device_defaults.go b/vendor/src/github.com/opencontainers/runc/libcontainer/configs/device_defaults.go
6466N/Aindex 0ce040f..e8f6ffc 100644
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/console_solaris.go b/vendor/src/github.com/opencontainers/runc/libcontainer/console_solaris.go
6466N/Aindex 0000000..d0e6819
6466N/A+// newConsole returns an initalized console that can be used within a container by copying bytes
6466N/A+// from the master side to the slave that is attached as the tty for the container's init process.
6466N/A+ return nil, errors.New("libcontainer console is not supported on Solaris")
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/container_solaris.go b/vendor/src/github.com/opencontainers/runc/libcontainer/container_solaris.go
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/stats_solaris.go b/vendor/src/github.com/opencontainers/runc/libcontainer/stats_solaris.go
6466N/A+ Stats *zones.Stats
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/system/sysconfig.go b/vendor/src/github.com/opencontainers/runc/libcontainer/system/sysconfig.go
6466N/Aindex b3a07cb..b6db51d 100644
6466N/Adiff --git a/vendor/src/github.com/opencontainers/runc/libcontainer/zones/stats.go b/vendor/src/github.com/opencontainers/runc/libcontainer/zones/stats.go
6466N/Aindex 0000000..a8bb6a0
6466N/A+ mu sync.Mutex // Protects access to watcher data
6466N/A+ fileExists map[string]bool // Keep track of if we know this file exists (to stop duplicate create events).
6466N/A+// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events.
6466N/A+ return nil, errors.New("Unable to create port")
6466N/A+ go w.readEvents()
6466N/A+ if w.isClosed {
6466N/A+ w.isClosed = true
6466N/A+ w.externalWatches[name] = true
6466N/A+ return w.addWatch(name, noteAllEvents)
6466N/A+ name = filepath.Clean(name)
6466N/A+ return fmt.Errorf("can't remove non-existent kevent watch for: %s", name)
6466N/A+ name = filepath.Clean(name)
6466N/A+ if w.isClosed {
6466N/A+ return errors.New("kevent instance already closed")
6466N/A+ name, err = filepath.EvalSymlinks(name)
6466N/A+ fmt.Printf("Error in port associate\n")
6466N/Adiff --git a/vendor/src/gopkg.in/fsnotify.v1/fen_cgo.go b/vendor/src/gopkg.in/fsnotify.v1/fen_cgo.go
6466N/Aindex 0000000..fac6022
6466N/A+// struct file_obj* newFobj () { return ((struct file_obj *) malloc(sizeof(struct file_obj))); }
6466N/A+// struct fileinfo* newFinf () { return ((struct fileinfo *) malloc(sizeof(struct fileinfo))); }
6466N/A+ return int(C.port_create())
6466N/A+ var x unix.Stat_t
6466N/A+ _, err := C.port_associate(C.int(port), C.PORT_SOURCE_FILE, C.uintptr_t(uintptr(unsafe.Pointer(fobj))), noteAllEvents, unsafe.Pointer(&finf))
6466N/A+ _, err := C.port_dissociate(C.int(port), C.PORT_SOURCE_FILE, C.uintptr_t(uintptr(unsafe.Pointer(fobj))))
6466N/A+ var pe C.struct_port_event
6466N/A+ switch pe.portev_source {
6466N/A+ case C.PORT_SOURCE_FILE:
6466N/A+ fmt.Printf("In default\n")
6466N/Adiff --git a/vendor/src/gopkg.in/fsnotify.v1/fsnotify.go b/vendor/src/gopkg.in/fsnotify.v1/fsnotify.go
6466N/Aindex c899ee0..d1d39a0 100644
6466N/A // Package fsnotify provides a platform-independent interface for file system notifications.
6466N/Aindex 60f0e76..ec807f0 100644