chapter8 Using Docker to Simplify CI Pipelines(Cannot connect to the Docker daemon)

I create docker environment for chapter8.
I installed by referring to the link below
https://docs.docker.com/engine/install/debian/
But I couldn't start docker.
Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:03:03 2020
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Please let me know if there is a solution.
Comments
-
Hi @maseita ,
I did a test case on Debian 10 and it worked. Can you do 'systemctl status docker.socket' and paste the output, please? Do the same for 'systemctl status docker.service'.
Regards,
Luis.0 -
Thank you for reply.
First of all, I explain my environment.
OS: GCP Debian GNU/Linux 10 \n \l
Jenkins: latest (docker image)
I installed by following command.
docker container run -itd --name jenkins -P -p 8080:8080 -v jenkins_home:/var/jerkins_home
-v /var/run/docker.sock:/var/run/docekr.sock jenkins/jenkins:latestI checked the execution result of 'systemctl status docker.socket'
[email protected]:/# systemctl status docker.socket
Failed to connect to bus: No such file or directoryBest Regards.
0 -
Hi @maseita ,
1.- First, I think the command 'docker container run -itd --name jenkins -P -p 8080:8080 -v jenkins_home:/var/jerkins_home
-v /var/run/docker.sock:/var/run/docekr.sock jenkins/jenkins:latest' has an error:You are using the -P and -p parameters, and they are exclusive. I mean, with -P you instruct Docker to choose a random port, and with -p you are specifying the ports. So you need to use -P or -p .
2.- Are you sure you have installed docker? Can you run the 'hello-world' to test your installation, please?
https://hub.docker.com/_/hello-world
You just need to do: docker run hello-world
And should have the following output:
docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/For more examples and ideas, visit:
https://docs.docker.com/get-started/Regards,
Luis.0 -
Thank you for reply.
my host machine environment is as follows.
[email protected]:~$ docker version
Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:02:55 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:01:25 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683[email protected]:~$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:4cf9c47f86df71d48364001ede3a4fcd85ae80ce02ebad74156906caff5378bc
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/[email protected]:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STA
TUS PORTS NAMES
1700a79c4c54 jenkins/jenkins:latest "/sbin/tini -- /usr/…" 10 seconds ago Up
5 seconds 0.0.0.0:8080->8080/tcp, 50000/tcp jenkinsI think that Docker is running on my host machine.
Is this confirmation correct?
Best Regards.
0 -
Hi @maseita ,
I think I found what's failing: so, you have Docker installed and working in your host, which is good, and that's why you can run Jenkins as a container. But for this lab, you need to install Docker into the Jenkins container. So I guess you missed that step.
You can see section Install Docker inside Jenkins Container in the lab, and follow the instructions.
I hope that helps
Luis.0 -
@maseita yes, as @luisviveropena mentions, docker needs to be installed and configured (authorisation) to run from inside the container running jenkins. Please refer the Lab Guide for the script to do so.
0
Categories
- 9.1K All Categories
- 15 LFX Mentorship
- 68 LFX Mentorship: Linux Kernel
- 380 Linux Foundation Boot Camps
- 233 Cloud Engineer Boot Camp
- 75 Advanced Cloud Engineer Boot Camp
- 30 DevOps Engineer Boot Camp
- 9 Cloud Native Developer Boot Camp
- 976 Training Courses
- 15 LFC110 Class Forum
- 16 LFD102 Class Forum
- 106 LFD103 Class Forum
- 6 LFD121 Class Forum
- 56 LFD201 Class Forum
- 1 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum
- 19 LFD254 Class Forum
- 450 LFD259 Class Forum
- 90 LFD272 Class Forum
- 1 LFD272-JP クラス フォーラム
- 16 LFS200 Class Forum
- 712 LFS201 Class Forum
- LFS201-JP クラス フォーラム
- 282 LFS211 Class Forum
- 50 LFS216 Class Forum
- 27 LFS241 Class Forum
- 28 LFS242 Class Forum
- 19 LFS243 Class Forum
- 6 LFS244 Class Forum
- 12 LFS250 Class Forum
- LFS250-JP クラス フォーラム
- 113 LFS253 Class Forum
- 814 LFS258 Class Forum
- 8 LFS258-JP クラス フォーラム
- 54 LFS260 Class Forum
- 81 LFS261 Class Forum
- 18 LFS262 Class Forum
- 76 LFS263 Class Forum
- 14 LFS264 Class Forum
- 10 LFS266 Class Forum
- 10 LFS267 Class Forum
- 9 LFS268 Class Forum
- 6 LFS269 Class Forum
- 182 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- 191 LFW211 Class Forum
- 114 LFW212 Class Forum
- 880 Hardware
- 207 Drivers
- 74 I/O Devices
- 44 Monitors
- 115 Multimedia
- 205 Networking
- 98 Printers & Scanners
- 82 Storage
- 730 Linux Distributions
- 85 Debian
- 64 Fedora
- 12 Linux Mint
- 13 Mageia
- 22 openSUSE
- 127 Red Hat Enterprise
- 33 Slackware
- 13 SUSE Enterprise
- 349 Ubuntu
- 450 Linux System Administration
- 33 Cloud Computing
- 64 Command Line/Scripting
- Github systems admin projects
- 89 Linux Security
- 76 Network Management
- 105 System Management
- 45 Web Management
- 51 Mobile Computing
- 19 Android
- 19 Development
- 1.2K New to Linux
- 1.1K Getting Started with Linux
- 501 Off Topic
- 121 Introductions
- 193 Small Talk
- 19 Study Material
- 756 Programming and Development
- 243 Kernel Development
- 479 Software Development
- 903 Software
- 247 Applications
- 178 Command Line
- 2 Compiling/Installing
- 73 Games
- 314 Installation
- 26 All In Program
- 26 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)