Welcome to the Linux Foundation Forum!

LFD254 Lab 3.1-3.10 on Ubuntu 20.04

Helio
Helio Posts: 27
edited June 2021 in LFD254 Class Forum

Hi Dears Masters!

For this Lab 3.1-3.10 from the LFD254, I am trying to install the Docker Architecture using docker-machine to create the drivers from DigitalOcean account to configure the dockerhost.

Unfortunately, always when I am running the command docker-machine came out saying that the dockerhost already existed; despite I have deleted each time before I regenerated new token still not working even the token is new, but the name have to be the same: dockerhost.

So, I am thinking that Cloud's DigitalOcean isn't respond proper due some mistaken I did on started the Lab whenI I generate new Token to export it to be using by docker-machine to create the dockerhost of the Docker Architecture. I think when I deleted on client side, the Ubuntu server side, registry, ... has to be the deleted too and update the information on my account. So, look like that your server remote side is not helping me.

I appreciate your help!
Many Thanks!

Please see the ScreenShot:

Comments

  • Hello Same problem... do you get an update ?

  • Helio
    Helio Posts: 27

    Hi @There!

    LFD254

    Yes, I deleted, destroyed and i did new setup updating everything on my system, which is Ubuntu 20.04, but this step: Create a Docker Host on DigitalOcean using ​docker-machine​, where ​dockerhost​ is our Docker Host name, such docker host is controlling by DigitalOcean server, which I believe has to be delete, destroy, or refresh and update too, so I can create a new image token and drivers to be used with the dockerhost, which will work.

    If you can, please take a look on Lab LFD254 - 3.31-3.10, so you have a better idea on this issue.

    These are the first 3 commands:

    1) $ curl -L
    https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-uname-s-uname -m >/tmp/docker-machine &&
    chmod +x /tmp/docker-machine &&
    sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

    2) $ export DO_TOKEN='14c91a0f332370bc89d9.......'

    3) docker-machine create --driver digitalocean --digitalocean-access-token=$DO_TOKEN dockerhost

    If it works the have to be like this:

    Creating CA: /root/.docker/machine/certs/ca.pem
    Creating client certificate: /root/.docker/machine/certs/cert.pem
    Running pre-create checks...
    Creating machine...
    (dockerhost) Creating SSH key...
    (dockerhost) Creating Digital Ocean droplet...
    (dockerhost) 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(systemd)...
    Installing Docker...
    Copying certs to the local machine directory...
    Copying certs to the remote machine...
    Setting Docker configuration on the remote daemon...
    Checking connection to Docker...

    As the daemon, server side did not install, when I ran the docker version, it comes like that:

    docker version
    Client: Docker Engine - Community
    Version: 20.10.7
    API version: 1.41
    Go version: go1.13.15
    Git commit: f0df350
    Built: Wed Jun 2 11:56:38 2021
    OS/Arch: linux/amd64
    Context: default
    Experimental: true
    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http:///var/run/docker.sock/v1.24/version: dial unix /var/run/docker.sock: connect: permission denied.

    So, when I ran the docker-machine ls, as it is not getting installed , it comes like that:

    docker-machine ls
    NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
    7611bfb91b1db6a956806a8c28ed827e8216a12ff957edd3633daa53db513a6a - digitalocean Error Unknown dropletID is invalid because cannot be less than 1
    dockerhost - digitalocean Error Unknown dropletID is invalid because cannot be less than 1
    helio-nyc1 - digitalocean Error Unknown dropletID is invalid because cannot be less than 1

    Regards!

  • Helio
    Helio Posts: 27

    LFD254 LAB 3.1-3.10

    Hi There!
    The problems above I fixed by using docker-machine commands. Unfortunately, now I have this one:

    docker-machine create --driver digitalocean --digitalocean-access-token=$DO_TOKEN dockerhost
    Running pre-create checks...
    Creating machine...
    (dockerhost) Creating SSH key...
    (dockerhost) Creating Digital Ocean droplet...
    Error creating machine: Error in driver during machine creation: POST https://api.digitalocean.com/v2/droplets: 422 You specified an invalid image for Droplet creation.

    I will appreciate your mastering on that!
    Helio

  • guyab
    guyab Posts: 6

    Hi

    I got the same error as Helio,

    docker-machine create --driver digitalocean --digitalocean-access-token=$DO_TOKEN dockerhost
    Creating CA: /root/.docker/machine/certs/ca.pem
    Creating client certificate: /root/.docker/machine/certs/cert.pem
    Running pre-create checks...
    Creating machine...
    (dockerhost) Creating SSH key...
    (dockerhost) Creating Digital Ocean droplet...
    Error creating machine: Error in driver during machine creation: POST https://api.digitalocean.com/v2/droplets: 422 You specified an invalid image for Droplet creation.

    I will appreciate any help
    Guy

  • Helio
    Helio Posts: 27
    edited July 2021

    LFD254 Lab 3.1-3.10

    Hi @Instructor Neependra Khare!

    I have completed many Linux Courses on this Foundation with other Instructors successfully basically without problems.
    Unfortunately, I got many problems to set up and run your Course LFD254. Which I have to run the docker-machine to create the drivers to setup the dockerhost with docker-machine tool to do these Labs.

    I got other problems before, but I fixed them. This one I believe do not depend only on my system, but on your Cloud system.

    So, this is the error:
    Then, when I ran docker-machine create --driver ...
    ...
    ....
    ...
    ...
    ...
    (dockerhost) Creating Digital Ocean droplet...
    Error creating machine: Error in driver during machine creation: POST https://api.digitalocean.com/v2/droplets: 422 You specified an invalid image for Droplet creation.

    Respectful,
    Helio.

  • chrispokorni
    chrispokorni Posts: 2,155

    Hi @Helio,

    The driver is attempting to provision a digital ocean droplet with an invalid image - which may no longer be available (based on the error message). You may customize your droplet's image by adding the --digitalocean-image ubuntu-18-04-x64 flag or ubuntu-20-04-x64 to the docker-machine create ... command.

    Another option would be to edit the /etc/systemd/system/docker.service.d/10-machine.conf file and add the desired image value.

    Regards,
    -Chris

  • Helio
    Helio Posts: 27

    Thanks!

  • guyab
    guyab Posts: 6

    Hi @There

    Error 422 has been resolved but I get this error now:

    root@ubuntu-s-1vcpu-1gb-intel-nyc3-01:~# docker-machine create --driver digitalocean --digitalocean-image ubuntu-20-04-x64 --digitalocean-access-token=$DO_TOKEN dockerhost
    Creating CA: /root/.docker/machine/certs/ca.pem
    Creating client certificate: /root/.docker/machine/certs/cert.pem
    Running pre-create checks...
    Creating machine...
    (dockerhost) Creating SSH key...
    (dockerhost) Creating Digital Ocean droplet...
    (dockerhost) 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(systemd)...
    Installing Docker...
    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: Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded

    I will appreciate any help!
    Guy

  • chrispokorni
    chrispokorni Posts: 2,155

    Hi @guyab,

    Can you manually validate that the Docker Daemon is running and listening on the newly created Docker Host?

    Regards,
    -Chris

  • guyab
    guyab Posts: 6

    The following steps were performed:

    1. curl -fsSL https://get.docker.com |sh
    2. curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine
    3. sudo mv /tmp/docker-machine /usr/local/bin/docker-machine
    4. chmod +x /usr/local/bin/docker-machine
    5. export DO_TOKEN=f877526d63c6b8836af37a6066f494a783b64681ae5517b9551284b985678a7a
    6. docker-machine create --driver digitalocean --digitalocean-image ubuntu-20-04-x64 --digitalocean-access-token=$DO_TOKEN dockerhost

    Error creating machine: Error running provisioning: Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded

    1. Manually validate that the Docker Daemon
      root@ubuntu-s-1vcpu-1gb-nyc3-01:~# dockerd
      INFO[2021-07-20T20:50:45.904317399Z] Starting up
      failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid

    root@ubuntu-s-1vcpu-1gb-nyc3-01:~# rm -rf /var/run/docker.pid
    root@ubuntu-s-1vcpu-1gb-nyc3-01:~# dockerd
    INFO[2021-07-20T20:55:03.083220408Z] Starting up
    INFO[2021-07-20T20:55:03.086518815Z] detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf
    INFO[2021-07-20T20:55:03.087825207Z] parsed scheme: "unix" module=grpc
    INFO[2021-07-20T20:55:03.088130600Z] scheme "unix" not registered, fallback to default scheme module=grpc
    INFO[2021-07-20T20:55:03.088368669Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 }] } module=grpc
    INFO[2021-07-20T20:55:03.088534259Z] ClientConn switching balancer to "pick_first" module=grpc
    INFO[2021-07-20T20:55:03.093751712Z] parsed scheme: "unix" module=grpc
    INFO[2021-07-20T20:55:03.093989510Z] scheme "unix" not registered, fallback to default scheme module=grpc
    INFO[2021-07-20T20:55:03.094107297Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 }] } module=grpc
    INFO[2021-07-20T20:55:03.094210074Z] ClientConn switching balancer to "pick_first" module=grpc
    INFO[2021-07-20T20:55:03.129850933Z] [graphdriver] using prior storage driver: overlay2
    failed to start daemon: error while opening volume store metadata database: timeout
    root@ubuntu-s-1vcpu-1gb-nyc3-01:~#

    root@ubuntu-s-1vcpu-1gb-nyc3-01:~# systemctl stop docker
    root@ubuntu-s-1vcpu-1gb-nyc3-01:~# dockerd
    INFO[2021-07-20T21:02:41.569179294Z] Starting up
    INFO[2021-07-20T21:02:41.571445041Z] detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf
    INFO[2021-07-20T21:02:41.572811363Z] parsed scheme: "unix" module=grpc
    INFO[2021-07-20T21:02:41.573031350Z] scheme "unix" not registered, fallback to default scheme module=grpc
    INFO[2021-07-20T21:02:41.573202859Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 }] } module=grpc
    INFO[2021-07-20T21:02:41.573337989Z] ClientConn switching balancer to "pick_first" module=grpc
    INFO[2021-07-20T21:02:41.577281803Z] parsed scheme: "unix" module=grpc
    INFO[2021-07-20T21:02:41.577435455Z] scheme "unix" not registered, fallback to default scheme module=grpc
    INFO[2021-07-20T21:02:41.577533666Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock 0 }] } module=grpc
    INFO[2021-07-20T21:02:41.577612032Z] ClientConn switching balancer to "pick_first" module=grpc
    INFO[2021-07-20T21:02:41.604048369Z] [graphdriver] using prior storage driver: overlay2
    WARN[2021-07-20T21:02:41.607183594Z] Your kernel does not support swap memory limit
    WARN[2021-07-20T21:02:41.607462328Z] Your kernel does not support CPU realtime scheduler
    WARN[2021-07-20T21:02:41.607610083Z] Your kernel does not support cgroup blkio weight
    WARN[2021-07-20T21:02:41.607722256Z] Your kernel does not support cgroup blkio weight_device
    INFO[2021-07-20T21:02:41.608253450Z] Loading containers: start.
    INFO[2021-07-20T21:02:41.739161188Z] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address
    INFO[2021-07-20T21:02:41.776841735Z] Loading containers: done.
    INFO[2021-07-20T21:02:41.803702061Z] Docker daemon commit=b0f5bc3 graphdriver(s)=overlay2 version=20.10.7
    INFO[2021-07-20T21:02:41.804092294Z] Daemon has completed initialization
    INFO[2021-07-20T21:02:41.836954811Z] API listen on /var/run/docker.sock

    Am I missing something? steps 1-6 according LFD254-Labs.pdf
    (my OS is Ubuntu 20.04.2)

    Guy

  • guyab
    guyab Posts: 6
    edited July 2021

    Hi @chrispokorni

    I will appreciate help!!

    Thanks
    Guy

  • chrispokorni
    chrispokorni Posts: 2,155

    Hi @guyab,

    After receiving the same error, I was still able to validate that docker was running on the dockerhost VM, and I followed thru the steps to run the alpine container on the dockerhost VM and it all worked as expected.

    Run the eval command as instructed and try to list ls your machines, then run a few containers on your dockerhost.

    Regards,
    -Chris

  • Helio
    Helio Posts: 27

    Hi @chrispokorni

    In Fine!
    Great News!
    Look That:

    docker-machine ls
    NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
    dockerhost * digitalocean Running tcp://45.55.40.76:2376 v20.10.7 .

    Thanks To Be Nice!
    Helio

  • guyab
    guyab Posts: 6

    Hi @chrispokorni

    root@ubuntu-s-1vcpu-1gb-nyc3-01:~# eval $(docker-machine env dockerhost)
    root@ubuntu-s-1vcpu-1gb-nyc3-01:~# docker-machine ls
    NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
    dockerhost * digitalocean Running tcp://165.227.218.147:2376 v20.10.7

    Thank you!!! :smile:
    Guy

Categories

Upcoming Training