diff --git a/components/engine/cmd/dockerd/config_solaris.go b/components/engine/cmd/dockerd/config_solaris.go deleted file mode 100644 index ec4be281eb..0000000000 --- a/components/engine/cmd/dockerd/config_solaris.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import ( - "github.com/docker/docker/daemon/config" - "github.com/spf13/pflag" -) - -// installConfigFlags adds flags to the pflag.FlagSet to configure the daemon -func installConfigFlags(conf *config.Config, flags *pflag.FlagSet) { - // First handle install flags which are consistent cross-platform - installCommonConfigFlags(conf, flags) - - // Then install flags common to unix platforms - installUnixConfigFlags(conf, flags) -} diff --git a/components/engine/container/state_solaris.go b/components/engine/container/state_solaris.go deleted file mode 100644 index 1229650efa..0000000000 --- a/components/engine/container/state_solaris.go +++ /dev/null @@ -1,7 +0,0 @@ -package container - -// setFromExitStatus is a platform specific helper function to set the state -// based on the ExitStatus structure. -func (s *State) setFromExitStatus(exitStatus *ExitStatus) { - s.ExitCodeValue = exitStatus.ExitCode -} diff --git a/components/engine/daemon/cluster/listen_addr_linux.go b/components/engine/daemon/cluster/listen_addr_linux.go index 3d4f239bda..2f342fd605 100644 --- a/components/engine/daemon/cluster/listen_addr_linux.go +++ b/components/engine/daemon/cluster/listen_addr_linux.go @@ -1,5 +1,3 @@ -// +build linux - package cluster import ( diff --git a/components/engine/daemon/cluster/listen_addr_solaris.go b/components/engine/daemon/cluster/listen_addr_solaris.go deleted file mode 100644 index 57a894b251..0000000000 --- a/components/engine/daemon/cluster/listen_addr_solaris.go +++ /dev/null @@ -1,57 +0,0 @@ -package cluster - -import ( - "bufio" - "fmt" - "net" - "os/exec" - "strings" -) - -func (c *Cluster) resolveSystemAddr() (net.IP, error) { - defRouteCmd := "/usr/sbin/ipadm show-addr -p -o addr " + - "`/usr/sbin/route get default | /usr/bin/grep interface | " + - "/usr/bin/awk '{print $2}'`" - out, err := exec.Command("/usr/bin/bash", "-c", defRouteCmd).Output() - if err != nil { - return nil, fmt.Errorf("cannot get default route: %v", err) - } - - defInterface := strings.SplitN(string(out), "/", 2) - defInterfaceIP := net.ParseIP(defInterface[0]) - - return defInterfaceIP, nil -} - -func listSystemIPs() []net.IP { - var systemAddrs []net.IP - cmd := exec.Command("/usr/sbin/ipadm", "show-addr", "-p", "-o", "addr") - cmdReader, err := cmd.StdoutPipe() - if err != nil { - return nil - } - - if err := cmd.Start(); err != nil { - return nil - } - - scanner := bufio.NewScanner(cmdReader) - go func() { - for scanner.Scan() { - text := scanner.Text() - nameAddrPair := strings.SplitN(text, "/", 2) - // Let go of loopback interfaces and docker interfaces - systemAddrs = append(systemAddrs, net.ParseIP(nameAddrPair[0])) - } - }() - - if err := scanner.Err(); err != nil { - fmt.Printf("scan underwent err: %+v\n", err) - } - - if err := cmd.Wait(); err != nil { - fmt.Printf("run command wait: %+v\n", err) - } - - return systemAddrs -} diff --git a/components/engine/daemon/config/config_solaris.go b/components/engine/daemon/config/config_solaris.go deleted file mode 100644 index 6b1e061b58..0000000000 --- a/components/engine/daemon/config/config_solaris.go +++ /dev/null @@ -1,30 +0,0 @@ -package config - -// Config defines the configuration of a docker daemon. -// These are the configuration settings that you pass -// to the docker daemon when you launch it with say: `docker -d -e lxc` -type Config struct { - CommonConfig - - // These fields are common to all unix platforms. - CommonUnixConfig -} - -// BridgeConfig stores all the bridge driver specific -// configuration. -type BridgeConfig struct { - commonBridgeConfig - - // Fields below here are platform specific. - commonUnixBridgeConfig -} - -// IsSwarmCompatible defines if swarm mode can be enabled in this config -func (conf *Config) IsSwarmCompatible() error { - return nil -} - -// ValidatePlatformConfig checks if any platform-specific configuration settings are invalid. -func (conf *Config) ValidatePlatformConfig() error { - return nil -} diff --git a/components/engine/daemon/exec_solaris.go b/components/engine/daemon/exec_solaris.go deleted file mode 100644 index 7c1fc20a0c..0000000000 --- a/components/engine/daemon/exec_solaris.go +++ /dev/null @@ -1,11 +0,0 @@ -package daemon - -import ( - "github.com/docker/docker/container" - "github.com/docker/docker/daemon/exec" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func (daemon *Daemon) execSetPlatformOpt(_ *container.Container, _ *exec.Config, _ *specs.Process) error { - return nil -} diff --git a/components/engine/daemon/inspect_unix.go b/components/engine/daemon/inspect_linux.go similarity index 99% rename from components/engine/daemon/inspect_unix.go rename to components/engine/daemon/inspect_linux.go index f073695e33..8d334dcf90 100644 --- a/components/engine/daemon/inspect_unix.go +++ b/components/engine/daemon/inspect_linux.go @@ -1,5 +1,3 @@ -// +build !windows - package daemon import ( diff --git a/components/engine/daemon/inspect_solaris.go b/components/engine/daemon/inspect_solaris.go deleted file mode 100644 index 0b275c1418..0000000000 --- a/components/engine/daemon/inspect_solaris.go +++ /dev/null @@ -1,27 +0,0 @@ -package daemon - -import ( - "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/backend" - "github.com/docker/docker/api/types/versions/v1p19" - "github.com/docker/docker/container" - "github.com/docker/docker/daemon/exec" -) - -// This sets platform-specific fields -func setPlatformSpecificContainerFields(container *container.Container, contJSONBase *types.ContainerJSONBase) *types.ContainerJSONBase { - return contJSONBase -} - -// containerInspectPre120 get containers for pre 1.20 APIs. -func (daemon *Daemon) containerInspectPre120(name string) (*v1p19.ContainerJSON, error) { - return &v1p19.ContainerJSON{}, nil -} - -func inspectExecProcessConfig(e *exec.Config) *backend.ExecProcessConfig { - return &backend.ExecProcessConfig{ - Tty: e.Tty, - Entrypoint: e.Entrypoint, - Arguments: e.Args, - } -} diff --git a/components/engine/daemon/listeners/listeners_unix.go b/components/engine/daemon/listeners/listeners_linux.go similarity index 99% rename from components/engine/daemon/listeners/listeners_unix.go rename to components/engine/daemon/listeners/listeners_linux.go index 3a7c0f85b0..7e0aaa237f 100644 --- a/components/engine/daemon/listeners/listeners_unix.go +++ b/components/engine/daemon/listeners/listeners_linux.go @@ -1,5 +1,3 @@ -// +build !windows - package listeners import ( diff --git a/components/engine/daemon/listeners/listeners_solaris.go b/components/engine/daemon/listeners/listeners_solaris.go deleted file mode 100644 index ee1bd0fccf..0000000000 --- a/components/engine/daemon/listeners/listeners_solaris.go +++ /dev/null @@ -1,43 +0,0 @@ -package listeners - -import ( - "crypto/tls" - "fmt" - "net" - "os" - - "github.com/docker/go-connections/sockets" - "github.com/sirupsen/logrus" -) - -// Init creates new listeners for the server. -func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) (ls []net.Listener, err error) { - switch proto { - case "tcp": - l, err := sockets.NewTCPSocket(addr, tlsConfig) - if err != nil { - return nil, err - } - ls = append(ls, l) - case "unix": - gid, err := lookupGID(socketGroup) - if err != nil { - if socketGroup != "" { - if socketGroup != defaultSocketGroup { - return nil, err - } - logrus.Warnf("could not change group %s to %s: %v", addr, defaultSocketGroup, err) - } - gid = os.Getgid() - } - l, err := sockets.NewUnixSocket(addr, gid) - if err != nil { - return nil, fmt.Errorf("can't create unix socket %s: %v", addr, err) - } - ls = append(ls, l) - default: - return nil, fmt.Errorf("Invalid protocol format: %q", proto) - } - - return -} diff --git a/components/engine/daemon/monitor_solaris.go b/components/engine/daemon/monitor_solaris.go deleted file mode 100644 index 0995758000..0000000000 --- a/components/engine/daemon/monitor_solaris.go +++ /dev/null @@ -1,11 +0,0 @@ -package daemon - -import ( - "github.com/docker/docker/container" - "github.com/docker/docker/libcontainerd" -) - -// postRunProcessing perfoms any processing needed on the container after it has stopped. -func (daemon *Daemon) postRunProcessing(_ *container.Container, _ libcontainerd.EventInfo) error { - return nil -} diff --git a/components/engine/daemon/update_linux.go b/components/engine/daemon/update_linux.go index 41d3b5324a..966d74e350 100644 --- a/components/engine/daemon/update_linux.go +++ b/components/engine/daemon/update_linux.go @@ -1,5 +1,3 @@ -// +build linux - package daemon import ( diff --git a/components/engine/daemon/update_solaris.go b/components/engine/daemon/update_solaris.go deleted file mode 100644 index f3b545c5f0..0000000000 --- a/components/engine/daemon/update_solaris.go +++ /dev/null @@ -1,11 +0,0 @@ -package daemon - -import ( - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/libcontainerd" -) - -func toContainerdResources(resources container.Resources) libcontainerd.Resources { - var r libcontainerd.Resources - return r -} diff --git a/components/engine/daemon/update_windows.go b/components/engine/daemon/update_windows.go index 4f85f41dda..e60f63d92d 100644 --- a/components/engine/daemon/update_windows.go +++ b/components/engine/daemon/update_windows.go @@ -1,5 +1,3 @@ -// +build windows - package daemon import ( diff --git a/components/engine/plugin/manager_linux.go b/components/engine/plugin/manager_linux.go index eff21e1d05..59066c1d79 100644 --- a/components/engine/plugin/manager_linux.go +++ b/components/engine/plugin/manager_linux.go @@ -1,5 +1,3 @@ -// +build linux - package plugin import ( diff --git a/components/engine/plugin/manager_solaris.go b/components/engine/plugin/manager_solaris.go deleted file mode 100644 index ac03d6e639..0000000000 --- a/components/engine/plugin/manager_solaris.go +++ /dev/null @@ -1,30 +0,0 @@ -package plugin - -import ( - "fmt" - - "github.com/docker/docker/plugin/v2" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func (pm *Manager) enable(p *v2.Plugin, c *controller, force bool) error { - return fmt.Errorf("Not implemented") -} - -func (pm *Manager) initSpec(p *v2.Plugin) (*specs.Spec, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (pm *Manager) disable(p *v2.Plugin, c *controller) error { - return fmt.Errorf("Not implemented") -} - -func (pm *Manager) restore(p *v2.Plugin) error { - return fmt.Errorf("Not implemented") -} - -// Shutdown plugins -func (pm *Manager) Shutdown() { -} - -func setupRoot(root string) error { return nil } diff --git a/components/engine/plugin/manager_windows.go b/components/engine/plugin/manager_windows.go index 56a7ee3ece..ac03d6e639 100644 --- a/components/engine/plugin/manager_windows.go +++ b/components/engine/plugin/manager_windows.go @@ -1,5 +1,3 @@ -// +build windows - package plugin import (