0

I am unable to install docker swarm on my Ubuntu 14.04 system. I followed the instruction from the github page https://github.com/docker/swarm

$ mkdir -p $GOPATH/src/github.com/docker/ $ cd $GOPATH/src/github.com/docker/ $ git clone https://github.com/docker/swarm $ cd swarm $ $GOPATH/bin/godep go install .

I have golang and godep installed, and the $GOPATH set to a local directory. However, when i run the commands, all but the last $GOPATH/bin/godep go install . doesn't work.

It throws this error and exits with status 2

# github.com/samalba/dockerclient Godeps/_workspace/src/github.com/samalba/dockerclient/dockerclient.go:258: syntax error: unexpected range, expecting { Godeps/_workspace/src/github.com/samalba/dockerclient/dockerclient.go:258: missing statement after label Godeps/_workspace/src/github.com/samalba/dockerclient/dockerclient.go:261: syntax error: unexpected case, expecting semicolon or newline or } Godeps/_workspace/src/github.com/samalba/dockerclient/dockerclient.go:267: syntax error: argument to go/defer must be function call Godeps/_workspace/src/github.com/samalba/dockerclient/dockerclient.go:270: syntax error: unexpected } Godeps/_workspace/src/github.com/samalba/dockerclient/dockerclient.go:272: non-declaration statement outside function body Godeps/_workspace/src/github.com/samalba/dockerclient/dockerclient.go:273: syntax error: unexpected }

#github.com/mesos/mesos-go/detector Godeps/_workspace/src/github.com/mesos/mesos-go/detector/standalone.go:73: unknown http.Client field 'Timeout' in struct literal

#github.com/docker/libkv/store/etcd Godeps/_workspace/src/github.com/docker/libkv/store/etcd/etcd.go:83: unknown net.Dialer field 'KeepAlive' in struct literal Godeps/_workspace/src/github.com/docker/libkv/store/etcd/etcd.go:85: unknown http.Transport field 'TLSHandshakeTimeout' in struct literal godep: go exit status 2

Is there something that I left out ? An environment variable that wasnt initialized or some package that is required ?

030
  • 5,901
  • 13
  • 68
  • 110
vivek o.s
  • 9
  • 3
  • Ubuntu does not have a current version of Go. This is probably the source of the problem. Try a more reasonable distribution, such as Fedora. – Michael Hampton Aug 19 '15 at 20:22
  • Thanks Mr.Hampton, I will check it out and see if that fix the issue... – vivek o.s Aug 20 '15 at 18:11
  • Mr.Hampton, instead of working on fedora, I installed the latest version of Go(1.2.1) in ubuntu and yet the problem persist. – vivek o.s Aug 31 '15 at 20:36
  • That's not the latest version of Go. Not even close. And, if you were going to ignore my advice, then why ask me for help when it goes wrong? – Michael Hampton Aug 31 '15 at 20:36
  • I wasn't questioning your judgement Mr.Hampton, I am sorry if I made you feel that way Its just the Internet connection here is not the very best and having fedora downloaded, which is like 2.5Gb or so for a minimal iso, was taking a while to complete ...and I having to setup build and reach where I was now, seemed so far away. So installing latest version of Go seemed like a more reasonable approach. Updating Go using, Ubuntu did not get the most updated version, as you pointed it out, it wasn't even close. But I was able to do so using the gvm, and the errors went off .. :) – vivek o.s Sep 02 '15 at 22:28

1 Answers1

0

Once could also decided to install docker 1.12 as this document indicates that docker-swarm is included since this version:

To use Docker Engine in swarm mode, install the Docker Engine v1.12.0 or later from the Docker releases GitHub repository. Alternatively, install the latest Docker for Mac or Docker for Windows Beta.

Docker Engine 1.12 includes swarm mode for natively managing a cluster of Docker Engines called a swarm. Use the Docker CLI to create a swarm, deploy application services to a swarm, and manage swarm behavior.

030
  • 5,901
  • 13
  • 68
  • 110
  • When this question was asked, there was only one swarm, classic swarm. The swarm mode included in current versions of docker is run completely differently, and you can even run them both simultaneously. – BMitch Apr 27 '17 at 18:42