53 daemon/inspect_solaris.go | 30 + |
53 daemon/inspect_solaris.go | 30 + |
54 daemon/inspect_unix.go | 2 +- |
54 daemon/inspect_unix.go | 2 +- |
55 daemon/list_unix.go | 2 +- |
55 daemon/list_unix.go | 2 +- |
56 daemon/network.go | 7 + |
56 daemon/network.go | 7 + |
57 daemon/selinux_unsupported.go | 8 + |
57 daemon/selinux_unsupported.go | 8 + |
58 daemon/start.go | 14 + |
58 daemon/start.go | 58 ++ |
59 daemon/stats_collector_solaris.go | 139 +++ |
59 daemon/stats_collector_solaris.go | 139 +++ |
60 daemon/stats_collector_unix.go | 2 +- |
60 daemon/stats_collector_unix.go | 2 +- |
61 daemon/stats_solaris.go | 82 ++ |
61 daemon/stats_solaris.go | 82 ++ |
62 docker/daemon_solaris.go | 58 ++ |
62 docker/daemon_solaris.go | 58 ++ |
63 docker/daemon_unix.go | 2 +- |
63 docker/daemon_unix.go | 2 +- |
197 vendor/src/gopkg.in/fsnotify.v1/fen.go | 188 ++++ |
197 vendor/src/gopkg.in/fsnotify.v1/fen.go | 188 ++++ |
198 vendor/src/gopkg.in/fsnotify.v1/fen_cgo.go | 82 ++ |
198 vendor/src/gopkg.in/fsnotify.v1/fen_cgo.go | 82 ++ |
199 vendor/src/gopkg.in/fsnotify.v1/fsnotify.go | 2 +- |
199 vendor/src/gopkg.in/fsnotify.v1/fsnotify.go | 2 +- |
200 volume/local/local_unix.go | 2 +- |
200 volume/local/local_unix.go | 2 +- |
201 volume/store/store_unix.go | 2 +- |
201 volume/store/store_unix.go | 2 +- |
202 189 files changed, 8826 insertions(+), 1216 deletions(-) |
202 189 files changed, 8870 insertions(+), 1216 deletions(-) |
203 create mode 100644 Dockerfile.solaris |
203 create mode 100644 Dockerfile.solaris |
204 create mode 100644 container/container_solaris.go |
204 create mode 100644 container/container_solaris.go |
205 create mode 100644 container/state_solaris.go |
205 create mode 100644 container/state_solaris.go |
206 create mode 100755 contrib/mkimage/solaris |
206 create mode 100755 contrib/mkimage/solaris |
207 create mode 100644 daemon/config_solaris.go |
207 create mode 100644 daemon/config_solaris.go |
4585 + |
4585 + |
4586 +func mergeLxcConfIntoOptions(hostConfig *containertypes.HostConfig) ([]string, error) { |
4586 +func mergeLxcConfIntoOptions(hostConfig *containertypes.HostConfig) ([]string, error) { |
4587 + return nil, nil |
4587 + return nil, nil |
4588 +} |
4588 +} |
4589 diff --git a/daemon/start.go b/daemon/start.go |
4589 diff --git a/daemon/start.go b/daemon/start.go |
4590 index 418dace..7fe7b8a 100644 |
4590 index 418dace..a4c6e47 100644 |
4591 --- a/daemon/start.go |
4591 --- a/daemon/start.go |
4592 +++ b/daemon/start.go |
4592 +++ b/daemon/start.go |
4593 @@ -1,6 +1,8 @@ |
4593 @@ -1,7 +1,10 @@ |
4594 package daemon |
4594 package daemon |
4595 |
4595 |
4596 import ( |
4596 import ( |
4597 + "errors" |
4597 + "errors" |
4598 + "os" |
4598 + "os" |
4599 "runtime" |
4599 "runtime" |
|
4600 + "os/exec" |
4600 |
4601 |
4601 "github.com/Sirupsen/logrus" |
4602 "github.com/Sirupsen/logrus" |
4602 @@ -142,6 +144,18 @@ func (daemon *Daemon) containerStart(container *container.Container) (err error) |
4603 "github.com/docker/docker/container" |
|
4604 @@ -10,6 +13,8 @@ import ( |
|
4605 containertypes "github.com/docker/engine-api/types/container" |
|
4606 ) |
|
4607 |
|
4608 +const SVCCFG = "/usr/sbin/svccfg" |
|
4609 + |
|
4610 // ContainerStart starts a container. |
|
4611 func (daemon *Daemon) ContainerStart(name string, hostConfig *containertypes.HostConfig) error { |
|
4612 container, err := daemon.GetContainer(name) |
|
4613 @@ -109,6 +114,10 @@ func (daemon *Daemon) containerStart(container *container.Container) (err error) |
|
4614 return err |
|
4615 } |
|
4616 |
|
4617 + if err := daemon.injectHostConfig(container); err != nil { |
|
4618 + return err |
|
4619 + } |
|
4620 + |
|
4621 // Make sure NetworkMode has an acceptable value. We do this to ensure |
|
4622 // backwards API compatibility. |
|
4623 container.HostConfig = runconfig.SetDefaultNetModeIfBlank(container.HostConfig) |
|
4624 @@ -142,6 +151,18 @@ func (daemon *Daemon) containerStart(container *container.Container) (err error) |
4603 mounts = append(mounts, container.TmpfsMounts()...) |
4625 mounts = append(mounts, container.TmpfsMounts()...) |
4604 |
4626 |
4605 container.Command.Mounts = mounts |
4627 container.Command.Mounts = mounts |
4606 + |
4628 + |
4607 + if runtime.GOOS == "solaris" { |
4629 + if runtime.GOOS == "solaris" { |
4616 + } |
4638 + } |
4617 + |
4639 + |
4618 if err := daemon.waitForStart(container); err != nil { |
4640 if err := daemon.waitForStart(container); err != nil { |
4619 return err |
4641 return err |
4620 } |
4642 } |
|
4643 @@ -170,3 +191,40 @@ func (daemon *Daemon) Cleanup(container *container.Container) { |
|
4644 logrus.Warnf("%s cleanup: Failed to umount volumes: %v", container.ID, err) |
|
4645 } |
|
4646 } |
|
4647 + |
|
4648 +// injectHostConfig() should be abstracted away. |
|
4649 +// This patch will only be running Solaris, hence it's harmless. |
|
4650 +func (daemon *Daemon) injectHostConfig(container *container.Container) error { |
|
4651 + pathdnsXml := container.Root + "/dns_client.xml" |
|
4652 + pathnsswitchXml := container.Root + "/ns_switch.xml" |
|
4653 + repodb := container.BaseFS + "/etc/svc/repository.db" |
|
4654 + |
|
4655 + err := exec.Command(SVCCFG, "extract", "dns/client", ">", pathdnsXml).Run() |
|
4656 + if err != nil { |
|
4657 + logrus.Errorf("Error exporting dns/client: %v", err) |
|
4658 + return err |
|
4659 + } |
|
4660 + |
|
4661 + err = exec.Command(SVCCFG, "extract", "name-service/switch", ">", pathnsswitchXml).Run() |
|
4662 + if err != nil { |
|
4663 + logrus.Errorf("Error exporting name-service/switch: %v", err) |
|
4664 + return err |
|
4665 + } |
|
4666 + |
|
4667 + os.Setenv("SVCCFG_REPOSITORY", repodb) |
|
4668 + |
|
4669 + err = exec.Command(SVCCFG, "apply", pathdnsXml).Run() |
|
4670 + if err != nil { |
|
4671 + logrus.Errorf("Error applying dns/client: %v", err) |
|
4672 + } |
|
4673 + |
|
4674 + err = exec.Command(SVCCFG, "apply", pathnsswitchXml).Run() |
|
4675 + if err != nil { |
|
4676 + logrus.Errorf("Error applying name-service/switch: %v", err) |
|
4677 + } |
|
4678 + |
|
4679 + os.Remove(pathdnsXml) |
|
4680 + os.Remove(pathnsswitchXml) |
|
4681 + |
|
4682 + return err |
|
4683 +} |
4621 diff --git a/daemon/stats_collector_solaris.go b/daemon/stats_collector_solaris.go |
4684 diff --git a/daemon/stats_collector_solaris.go b/daemon/stats_collector_solaris.go |
4622 new file mode 100644 |
4685 new file mode 100644 |
4623 index 0000000..9a51b27 |
4686 index 0000000..9a51b27 |
4624 --- /dev/null |
4687 --- /dev/null |
4625 +++ b/daemon/stats_collector_solaris.go |
4688 +++ b/daemon/stats_collector_solaris.go |