Docker can create a new swarm - docker

I am using the docker docs to create a swarm
https://docs.docker.com/engine/swarm/swarm-tutorial/create-swarm/
[centos#dsm-manager1 ~]$ docker swarm init --advertise-addr 10.192.10.220
Error response from daemon: --live-restore daemon configuration is incompatible with swarm mode
[centos#dsm-manager1 ~]$
The version of docker I'm using
[centos#dsm-manager1 ~]$ docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24
Package version: docker-common-1.12.6-11.el7.centos.x86_64
Go version: go1.7.4
Git commit: 96d83a5/1.12.6
Built: Tue Mar 7 09:23:34 2017
OS/Arch: linux/amd64
The doc version is 1.17,I don't know whether this matters,
I just can't find the doc about swarm mode in version 1.12

For those who can’t find /etc/docker/daemon.json try /etc/sysconfig/docker
live-restore option is there:
OPTIONS=’–selinux-enabled --log-driver=journald --live-restore’

Related

Docker - Client version is newer than server

Docker daemon in minikube
When I do
docker version
I have
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)
I want to use export DOCKER_API_VERSION=1.23 to downgrade docker.
But it doesn't work when I use minikube and use eval $(minikube docker-env). The client version is always 1.23
Please see the image about the comparison before and after using minikube docker daemon. The DOCKER_API_VERSION is always 1.23. But the client version is not 1.23.
I cannot reproduce the issue with the newest minikube image and the latest docker installation. I think that the cause is that you are using an old version of minikube. Could you check that?
2017-10-04 17:17:34 ⌚ ip-192-168-200-196 in ~
○ → eval $(minikube docker-env)
2017-10-04 17:17:36 ⌚ ip-192-168-200-196 in ~
○ → docker version
Client:
Version: 17.09.0-ce
API version: 1.24 (downgraded from 1.23)
Go version: go1.8.3
Git commit: afdb6d4
Built: Tue Sep 26 22:40:09 2017
OS/Arch: darwin/amd64
Server:
Version: 1.12.6
API version: 1.24 (minimum version )
Go version: go1.6.4
Git commit: 78d1802
Built: Wed Jan 11 00:23:16 2017
OS/Arch: linux/amd64
Experimental: false
2017-10-04 17:17:41 ⌚ ip-192-168-200-196 in ~
○ → minikube version
minikube version: v0.22.2

Modifying Docker Images Directly

i'm new to docker. I run docker "natively" from a Windows server 2016 with a Windows container, there is no intermediate VM (no docker machine) in between and no docker toolbox, so the "host" is the actual Windows Server that I run docker on.
Docker version:
PS C:> docker version
Client:
Version: 17.03.1-ee-3
API version: 1.27
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64
Server:
Version: 17.03.1-ee-3
API version: 1.27 (minimum version 1.24)
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64
Experimental: false
PS C:\>
i pulled the image from docker hub. I need to replace the files inside the docker image while running and commit changes to the image.
Lets say i have Sample.java and datafile.properties inside the docker image which i pulled from docker hub.
i want to replace that with Hello.java and data.properties[ i pulled these files from github]
how would i do that in an automated way? Any advise and some examples on this would he helpful. Thanks in advance.

unable to find the /etc/default/docker with latest docker 17.03.0-ce

I have installed latest docker version 17.03.0-ce in centos 7 and please find the docker version details below,
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:10:07 2017
OS/Arch: linux/amd64
Experimental: false
I need to do an multi-host networking using swarm and i was following this link Lab 06: Docker Networking
They have mentioned to edit /etc/default/docker file to comment out DOCKER_OPTS value. But i couldnt see any file in my host machine. Where could i find this file to change the value of DOCKER_OPTS
The guide is for debian based systems that use /etc/default in Redhat based systems use:
/etc/sysconfig
in your case:
/etc/sysconfig/docker
You can edit the systemd unit file directly for your purpose, but its not recommended.

Docker Compose (docker-compose) couldn't connect to docker daemon on Windows Server 2016 TP5

I am trying to get docker-compose to work on Windows Server 2016 TP5. I have installed Docker Desktop for Windows (not Docker Toolbox) as a service, which works perfectly. I have downloaded the latest docker-compose for windows from https://dl.bintray.com/docker-compose/master/ and put it in the same path as Docker (after unblocking the downloaded file, and renaming it to docker-compose.exe.
When I run the docker-compose up (in Powershell as an Administrator), I get the following error:
ERROR: Couldn't connect to Docker daemon. You might need to install
Docker:
https://docs.docker.com/engine/installation/
Here are the docker and docker-compose information on my machine:
Docker:
Client:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: windows/amd64
Server:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 17:52:38 2016
OS/Arch: windows/amd64
Docker Compose:
docker-compose version 1.9.0dev, build f65f89a
You might want to try to set your DOCKER_HOST:
$ENV:DOCKER_HOST="npipe://\\.\pipe\docker_engine"
Alternatively, when registering the engine, you can make it listen on TCP too:
dockerd.exe -H npipe:////./pipe/docker_engine -H localhost:2375 --register-service
There are more details on this Compose issue

Why is docker-compose throwing an error?

$ docker-compose up
Creating network "app_default" with the default driver
ERROR: b'failed to parse pool request for address space "LocalDefault" pool "" subpool "": could not find an available predefined network'
What is the meaning of this error, and how can I fix it?
Additional context:
$ docker-compose version
docker-compose version 1.7.1, build 6c29830
docker-py version: 1.8.1
CPython version: 3.5.1
OpenSSL version: OpenSSL 1.0.2h 3 May 2016
$ docker version
Client:
Version: 1.10.3
API version: 1.22
Go version: go1.5.3
Git commit: 20f81dd
Built: Thu Mar 10 21:49:11 2016
OS/Arch: darwin/amd64
Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:20 2016
OS/Arch: linux/amd64
Are you using some vpn service?
Here is a link to a possible reason:
https://github.com/docker/libnetwork/issues/779
I was having this problem. Solved by removing all docker defined networks with:
docker network rm `docker network ls -q`

Resources