Tag Archives: docker

[Solved] Windows Install Docker Error: “docker engine failed to start…”

1. Problem Description
Referring to the installation of Docker client in linux environment, after completion, it reports "docker engine failed to start...".
2. Refer to the solution
Open Powershell as administrator and execute the following command:
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon

docker “mongo:systemctl start mongod.service” Error: mongod.service: New main PID 1390 does not belong to service, and PID file is not owned by root. Refusing.

Platform: Feiteng server + docker

 

 

Add parameters in docker run:

-v /sys/fs/cgroup:/sys/fs/cgroup

 

After docker exec into the container

chown -R mongodb:mongodb /var/lib/mongodb

 

[Solved] Docker Install Error: repodata/repomd.xml: [Errno 14] HTTPS Error 404 – Not Found Trying other mirror.

Install docker by referring to the official documentation and execute the command

sudo yum install -y yum-utils
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

sudo yum install docker-ce docker-ce-cli containerd.io

Throw an exception after

https://mirrors.aliyun.com/docker-ce/linux/centos/2.1903/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.


 One of the configured repositories failed (Docker CE Stable - x86_64),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=docker-ce-stable ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable docker-ce-stable
        or
            subscription-manager repos --disable=docker-ce-stable

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true

failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/docker-ce/linux/centos/2.1903/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

After investigation, it is found that it is in the warehouse configuration  $ releasever   Cause not found

It can be solved simply by modifying the warehouse configuration file.

Solution

1. Open the warehouse configuration file: vim /etc/yum.repos.d/docker-ce.repo

2. Editing docker-ce-stable Baseurl value for

[docker-ce-stable]
name=Docker CE Stable - $basearch
# baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable

After saving and exiting, the installation command can be executed normally

sudo yum install docker-ce docker-ce-cli containerd.io

 

[Solved] Docker error: Error starting daemon: Error initializing network controller: list bridge addresses failed: no available network

Errors:
1.# systemctl restart docker

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

2.# systemctl status docker.service

● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Thu 2021-11-25 18:12:33 CST; 1min 3s ago
Docs: https://docs.docker.com
Main PID: 35104 (code=exited, status=1/FAILURE)
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: Failed to start Docker Application Container Engine.
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: Unit docker.service entered failed state.
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: docker.service failed.
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: docker.service holdoff time over, scheduling restart.
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: Stopped Docker Application Container Engine.
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: start request repeated too quickly for docker.service
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: Failed to start Docker Application Container Engine.
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: Unit docker.service entered failed state.
Nov 25 18:12:33 xx:xx:xx:xx systemd[1]: docker.service failed.

3.# journalctl -xe

Nov 25 18:58:43 xx:xx:xx:xx dockerd[30363]: time="2021-11-25T18:58:43.204191101+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" modu
Nov 25 18:58:43 xx:xx:xx:xx dockerd[30363]: time="2021-11-25T18:58:43.204305943+08:00" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///var/ru
Nov 25 18:58:43 xx:xx:xx:xx dockerd[30363]: time="2021-11-25T18:58:43.204335414+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Nov 25 18:58:43 xx:xx:xx:xx dockerd[30363]: time="2021-11-25T18:58:43.204428835+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42053b820, CONNE
Nov 25 18:58:43 xx:xx:xx:xx dockerd[30363]: time="2021-11-25T18:58:43.204743716+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42053b820, READY
Nov 25 18:58:43 xx:xx:xx:xx dockerd[30363]: time="2021-11-25T18:58:43.204781727+08:00" level=info msg="Loading containers: start."
Nov 25 18:58:43 xx:xx:xx:xx dockerd[30363]: Error starting daemon: Error initializing network controller: list bridge addresses failed: no available network
Nov 25 18:58:43 xx:xx:xx:xx systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Nov 25 18:58:43 xx:xx:xx:xx systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
…………

Solution:
Inout in Teminal:
ip link add name docker0 type bridge
ip addr add dev docker0 172.17.0.1/16
then re-excetue
1)systemctl start docker
2)docker info | grep 'Server Version'

3)systemctl enable docker
Done!

Bash: sudo: command not found when sudo is used in the docker container

terms of settlement:

Check the Linux system version first:

cat /proc/version

1. RedHat mainly includes RedHat, Fedora, CentOS, etc;

The package management tool of RedHat series is Yum and up2date

yum install sudo -y

 

2. Debian system mainly includes Debian, Ubuntu, mint and their derivatives;

The package management tool of Debian series is apt get, which executes

apt-get update

apt-get install sudo

 

Docker Error: Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.

Check the execstart configuration in the/usr/lib/SYSTEMd/system/docker.service file. If the configuration is correct, proceed as follows.

Modify the following two configurations:

/Add {“storage driver”: “devicemapper”} to the/etc/docker/daemon.json file

Add docker to the/etc/sysconfig/docker storage file_STORAGE_Options = “– SELinux enabled — log driver = journald — signature verification = false”// if there is no such file, you can skip it

[Solved] Centos8 Install Docker Error: Error: Unable to find a match: docker

1. First update: yum -y update
2. Centos8 uses podman instead of docker by default, so containerd.io is needed, then we just install it
yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
The following commands are executed in sequence
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce

Docker’s error response from daemon [How to Solve]


Error Messages:

/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint mycdh (03b0b533cded5bb7c24256effceaf16bf5296b79addaf6f76dc5bd0d10d7c5ae): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 60010 -j DNAT --to-destination 172.17.0.2:60010 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).

Solution: Restart docker

systemctl restart docker