Error on create new generic docker machine - docker

I trying to create new docker-machine with driver "generic" on VPS and I get this error:
MacBook-Pro-Pavel:demo pavel$ docker-machine create --driver generic --generic-ssh-key ~/.ssh/id_rsa --generic-ip-address=5.63.154.209 regru
Running pre-create checks...
Creating machine...
(regru) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with debian...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Error creating machine: Error running provisioning: ssh command error:
command : sudo systemctl -f start docker
err : exit status 1
output : Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
Machine with driver "virtualbox" create normally:
MacBook-Pro-Pavel:~ pavel$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
regru - generic Running tcp://5.63.154.209:2376 Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
swarm-node-0 - virtualbox Running tcp://192.168.99.100:2376 v17.06.0-ce
swarm-node-1 - virtualbox Running tcp://192.168.99.101:2376 v17.06.0-ce
systemctl status docker.service и journalctl -xn here.
What am I doing wrong?
UPDATE
$ docker version
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:31:53 2017
OS/Arch: darwin/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:51:55 2017
OS/Arch: linux/amd64
Experimental: true

Chances are, you are doing everything right.
It seems there is an issue with docker.
I don't have much understanding, however here is a link for details:
https://forums.docker.com/t/docker-machine-create-fails-on-digitalocean/34750
Work around is to manually provide older docker engine:
docker-machine create
--driver amazonec2
--engine-install-url=https://web.archive.org/web/20170623081500/https://get.docker.com
Add --engine-install-url to your setup and see if that works.

Related

Cannot stop defunct docker-containe

I had stoped the docker-deamon, but there still docker processes running, kill -9 PID or killall -9 containerd didn't work. When I restart the docker, some error occurs.
docker-deamon status
defunct docker-containe
start docker-deamon error
messages
docker version:
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:20:16 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
See topic 51881286 where the problem has been solved previously. The post installation steps for Linux should be done.

Error with Docker daemon for docker installation on Fiware cloud

I am new with the Fiware and docker technologies so I need some help.
I am following the instructions from this link http://simple-docker-hosting-on-fiware-cloud.readthedocs.io/en/v1.0/manuals/install in order to create a docker-host machine on Fiware cloud but when I run the following command:
docker-machine create -d openstack --openstack-flavor-id="2" --openstack-image-name="base_ubuntu_14.04" --openstack-net-name="node-int-net-01" --openstack-floatingip-pool="public-ext-net-01" --openstack-sec-groups="docker-sg" --openstack-ssh-user "ubuntu" docker-host
I receive the following error:
Error creating machine: Error running provisioning: Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded
Although, I can see the instance of the docker-host machine on Fiware cloud, but when I run the following command:
eval "$(docker-machine env docker-host)"
the following error comes up:
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "147.27.60.136:2376": dial tcp 147.27.60.136:2376: connectex: No connection could be made because the target machine actively refused it.
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.**
I also tried to regenerate the certificates:
docker-machine regenerate-certs docker-host
but I received the following error:
Error getting SSH command to check if the daemon is up: ssh command error:
command : sudo docker version
err : exit status 1
output : Client:
Version: 18.04.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 3d479c0
Built: Tue Apr 10 18:21:14 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?**
Image with the result for the Command: docker-machine ls
What am I doing wrong?
I use docker community edition for windows 10.
The docker version is:
Client:
Version: 18.03.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:06:28 2018
OS/Arch: windows/amd64
Experimental: false
Orchestrator: swarm
Server:
Version: 18.03.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:14:32 2018
OS/Arch: linux/amd64
Experimental: false
First make sure you've opened your docker port (tcp/2376) in your default security group
Let me suggest you using base_ubuntu_16.04 instead of base_ubuntu_14.04
Anyway, it won't run properly at first. There is a problem with the latests versions of docker and docker-machine. As a workaround, after running your docker-machine command, you can do this to fix the problem:
ssh docker-host 'sudo apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual ; sudo modprobe aufs ; sudo service docker start'
However, you might find furhter problems due to MTU configuration in your docker host. To solve them, you can lower your MTU with these commands:
docker-machine ssh docker-host "sudo sed -i 's/--label provider=openstack/--label provider=openstack\n--mtu=1400/g' /etc/default/docker"
docker-machine ssh docker-host "sudo service docker restart"
docker-machine ssh docker-host "sudo ip link set mtu 1400 dev docker0"

Enable Docker Remote API - raspberry pi / raspbian

My starting point is:
How to use docker remote api to create container?,
so I edit /etc/init/docker.conf and update 2 occurrences of the DOCKER_OPTS variable to:
DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock'
Then, a simple test to list docker images fails:
$ service docker restart
$ curl -X GET http://10.143.0.218:4243/images/json
curl: (7) Failed to connect to 10.143.0.218 port 4243: Connection refused
Docker version is:
$ sudo docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
The solution comes from the comments of this page: http://www.virtuallyghetto.com/2014/07/quick-tip-how-to-enable-docker-remote-api.html
[08/18/2016 at 6:00 am] Oliver Weise says:
Thanks, that put me in the right direction. However since Ubuntu 16.04
with its systemd docker daemon the /etc/default/docker is no longer
effective. Instead you need to create a systemd dropin file.
I placed such a file under: /etc/systemd/system/docker.service.d/remote-api.conf
With the contents:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2376 -H unix:///var/run/docker.sock
(Yes, the double ExecStart is necessary)
After that run:
sudo systemctl daemon-reload // reloading daemon definitions
sudo systemctl restart docker
Not tested this, but if it's Jessie, then it uses systemd by default as the init system iirc, and this has implications for how the daemon (dockerd) is configured and started.
So you're editing the /etc/init/docker.conf file but I don't think that's being read / used.
Take a read of this article on different startup procedures on each init system in Docker, and this for specific systemd configuration.

Cannot leave swarm mode

I've been tinkering with new Docker swarm mode. I can't fully recall the steps that I did, but now I'm stuck in situation where my docker engine is as a worker in a non-existing swarm:
$ docker info
...
Swarm: active
NodeID: 1vndsuqa0r3paswufs7eq4po3
Is Manager: false
Node Address: 192.168.65.2
...
$ docker swarm leave
Error response from daemon: context deadline exceeded
$ docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:04:48 2016
OS/Arch: darwin/amd64
Experimental: true
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:04:48 2016
OS/Arch: linux/amd64
Experimental: true
How could I get out the swarm mode?
I believe this was a bug in 1.12.0 that has been resolved since (I believe the patch should be included in 1.12.3). Here is the Related Issue.
But if the problem persists with the new version somehow, there are a few additional options:
# Force quit the cluster
docker swarm leave --force
or
# Force a new cluster and leave properly
docker swarm init --force-new-cluster
docker swarm leave
I finally managed to fix this by resetting docker back to factory defaults from Docker menu > Preferences > Uninstall / Reset > Reset to factory defaults (I'm using Docker for Mac beta). Note that this operation also swipes all docker images, volumes, networks, etc.

Error creating DigitalOcean droplet using docker-machine

Not sure if it's a DigitalOcean problem or docker-machine but I get this error repeatedly while trying to create a droplet on DO
$ docker-machine create --driver digitalocean --digitalocean-access-token=$TOKEN --digitalocean-region=sgp1 --digitalocean-image=ubuntu-14-04-x64 --digitalocean-size "1gb" staging
Running pre-create checks...
Creating machine...
(staging) Creating SSH key...
(staging) Creating Digital Ocean droplet...
(staging) Waiting for IP address to be assigned to the Droplet...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(upstart)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Error creating machine: Error running provisioning: Get https://api.digitalocean.com/v2/droplets/17900941: dial tcp: lookup api.digitalocean.com on 127.0.1.1:53: read udp 127.0.0.1:40376->127.0.1.1:53: i/o timeout
I am using following docker packages on Ubuntu 14.04
$ docker-machine version
docker-machine version 0.7.0, build a650a40
$ docker version
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:47:50 2016
OS/Arch: linux/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
Error is: read udp 127.0.0.1:40376->127.0.1.1:53: i/o timeout
Looks like its trying to use localhost as the nameserver and no DNS server is running.
What is your /etc/resolv.conf file looking like?
Two ways to fix this: bring up the DNS server on the local box or, the better way, fix your DNS server setup in that file and use e.g. 8.8.8.8 as the nameserver.
Not 100% sure but I solved the problem as following.
I was developing in virtualbox machine and I ran the command when I started work
eval "$(docker-machine env local)"
So my docker-machine env was set to some variables, because of which running docker-machine create in the same terminal was causing DNS resolution problem.
Just started a new terminal and was able to create a DigitalOcean droplet without any problem.

Resources