Compiling Traefik on illumos

Sombody asked for help to compile traefik on illumos today, so I figured I'll write up a quick guide

You will need the following packages * npm * nodejs * go 1.13+

I am using pkgsrc to be compatible with most illumos distros

Critical: npm must be run as unprivileged and /opt/local/bin must be in PATH

# Ensure npm works
export PATH=/usr/gnu/bin:$GOPATH/bin:$PATH:/opt/local/bin

# On Openindiana install go 1.13
pkg install golang-113

# Install required packages
pkgin in nodejs-10.16.3 npm

# Get the sources
git clone git@github.com:containous/traefik.git
cd traefik
git checkout v2.0.5

# based on the Dockerfiles get the module dependencies
go mod download

# Compile the WebUI
# note that I had to do this on a linux host as node-sass did not want to compile for me..... 
pushd webui
npm install
npm run build
mv dist/pwa/* ../static/
popd

# Here you will need to patch dockers client code a bit for traefik to build
# add "solaris illumos" to $GOPATH/pkg/mod/github.com/docker/engine@v0.0.0-20190725163905-fa8dd90ceb7b/client/client_unix.go
# see https://github.com/docker/engine/compare/master...Toasterson:patch-1
# a Pull Request is opened for this with the guys from docker 
# https://github.com/docker/engine/pull/426

GO111MODULE=off go get github.com/containous/go-bindata/...

./script/generate
./script/binary

And that gets you a working traefik binary.

EDIT: thanks to Wonko on IRC we now have a patch that takes out docker support from traefik as well.

Works with 2.1.3, untested with any other version:

diff --git a/pkg/config/static/static_config.go b/pkg/config/static/static_config.go
index af3eb8e7..0c5cc342 100644
--- a/pkg/config/static/static_config.go
+++ b/pkg/config/static/static_config.go
@@ -10,7 +10,7 @@ import (
        "github.com/containous/traefik/v2/pkg/ping"
        acmeprovider "github.com/containous/traefik/v2/pkg/provider/acme"
        "github.com/containous/traefik/v2/pkg/provider/consulcatalog"
-       "github.com/containous/traefik/v2/pkg/provider/docker"
+       // "github.com/containous/traefik/v2/pkg/provider/docker"
        "github.com/containous/traefik/v2/pkg/provider/file"
        "github.com/containous/traefik/v2/pkg/provider/kubernetes/crd"
        "github.com/containous/traefik/v2/pkg/provider/kubernetes/ingress"
@@ -155,7 +155,7 @@ func (t *Tracing) SetDefaults() {
 // Providers contains providers configuration
 type Providers struct {
        ProvidersThrottleDuration types.Duration          `description:"Backends throttle duration: minimum duration between 2 events from providers before applying a new configuration. It avoids unnecessary reloads if multiples events are sent in a short amount of time." json:"providersThrottleDuration,omitempty" toml:"providersThrottleDuration,omitempty" yaml:"providersThrottleDuration,omitempty" export:"true"`
-       Docker                    *docker.Provider        `description:"Enable Docker backend with default settings." json:"docker,omitempty" toml:"docker,omitempty" yaml:"docker,omitempty" export:"true" label:"allowEmpty"`
+       // Docker                    *docker.Provider        `description:"Enable Docker backend with default settings." json:"docker,omitempty" toml:"docker,omitempty" yaml:"docker,omitempty" export:"true" label:"allowEmpty"`
        File                      *file.Provider          `description:"Enable File backend with default settings." json:"file,omitempty" toml:"file,omitempty" yaml:"file,omitempty" export:"true"`
        Marathon                  *marathon.Provider      `description:"Enable Marathon backend with default settings." json:"marathon,omitempty" toml:"marathon,omitempty" yaml:"marathon,omitempty" export:"true" label:"allowEmpty"`
        KubernetesIngress         *ingress.Provider       `description:"Enable Kubernetes backend with default settings." json:"kubernetesIngress,omitempty" toml:"kubernetesIngress,omitempty" yaml:"kubernetesIngress,omitempty" export:"true" label:"allowEmpty"`
@@ -187,11 +187,11 @@ func (c *Configuration) SetEffectiveConfiguration() {
                }
        }
 
-       if c.Providers.Docker != nil {
-               if c.Providers.Docker.SwarmModeRefreshSeconds <= 0 {
-                       c.Providers.Docker.SwarmModeRefreshSeconds = types.Duration(15 * time.Second)
-               }
-       }
+//     if c.Providers.Docker != nil {
+//             if c.Providers.Docker.SwarmModeRefreshSeconds <= 0 {
+//                     c.Providers.Docker.SwarmModeRefreshSeconds = types.Duration(15 * time.Second)
+//             }
+//     }
 
        if c.Providers.Rancher != nil {
                if c.Providers.Rancher.RefreshSeconds <= 0 {
diff --git a/pkg/provider/aggregator/aggregator.go b/pkg/provider/aggregator/aggregator.go
index 7bcdee70..6e7c796f 100644
--- a/pkg/provider/aggregator/aggregator.go
+++ b/pkg/provider/aggregator/aggregator.go
@@ -25,9 +25,9 @@ func NewProviderAggregator(conf static.Providers) ProviderAggregator {
                p.quietAddProvider(conf.File)
        }
 
-       if conf.Docker != nil {
-               p.quietAddProvider(conf.Docker)
-       }
+//     if conf.Docker != nil {
+//             p.quietAddProvider(conf.Docker)
+//     }
 
        if conf.Marathon != nil {
                p.quietAddProvider(conf.Marathon)