Tag Archives: docker

Transaction check error during docker CE installation [How to Solve]

Installing docker CE under CentOS is
this is because I have installed docker more than once on the machine. Some dependency conflicts are caused by version reasons. You need to find the conflicting dependencies and delete the old dependencies:

# View conflicting dependency packages
yum list installed | grep docker

Delete and reinstall the specified other version:
rpm -e docker-client.x86_64 and rpm -e docker-common.x86_64

[Solved] Error in installing docker requires: fuse overlayfs >= 0.7

Cause: there is an error docker during installation, and the docker of CentOS 7.9 installation reports an error. Requirements: fuse overlays> = 0.7

el7.x86_64
---> Package docker-scan-plugin.x86_64 0:0.8.0-3.el7 will be installed
---> Package libcgroup.x86_64 0:0.41-21.el7 will be installed
---> Package libseccomp.x86_64 0:2.3.1-4.el7 will be installed
--> Finished Dependency Resolution
Error: Package: 3:docker-ce-20.10.8-3.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64 (docker-ce-stable)
           Requires: fuse-overlayfs >= 0.7
Error: Package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64 (docker-ce-stable)
           Requires: slirp4netns >= 0.4
Error: Package: containerd.io-1.4.9-3.1.el7.x86_64 (docker-ce-stable)


Solution:

#Go to the yum source configuration folder
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo_bak

Add an entry to /etc/yum.repos.d/docker-ce.repo at the top of the file, as follows
[centos-extras]
name=Centos extras - $basearch
baseurl=http://mirror.centos.org/centos/7/extras/x86_64
enabled=1
gpgcheck=0

# save and quit


#Then install the command:
yum -y install slirp4netns fuse-overlayfs container-selinux


Docker starts MySQL container and reports an error driver failed programming external connectivity on endpoint mysq

Look at the error first:

The mistake is like the above. At first, I thought my command was wrong or something else, but later I found it was not

But it’s still troubleshooting one by one.
first, the command to create a MySQL container:
docker create – P 3306:3306 — name of the container – e mysql_ ROOT_ Password = database password MySQL version:

After creation, enter the command: docker PS – a
to view all containers

Then you can see the MySQL you just named

Start command:
docker start container ID

Then an error will be reported. If an error is reported, please see the following:

Problem solving:

The first is to restart the docker. It is useless for me to restart anyway. The restart command:
systemctl restart docker
it is also possible that you will be OK after restarting

The second is to view all containers through the docker PS – a command. If you have created MySQL before, when you create a MySQL container again, you need to change an external port, not 3306. Ensure that the port and name are different from the MySQL container created before

You can also use the previous MySQL container and start it directly through the docker start container ID

Solve the problem of docker error: Unsupported compose file version: 3.2

The following error occurred when using docker to deploy the project today:

unsupported Compose file version: 3.2

It seems that there is a version problem by searching the data:
https://stackoverflow.com/questions/58007968/unsupported-compose-file-version-x-x

Solution:
upgrade the docker and docker compose versions to the latest versions.

Mac Docker pull Error: Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable

Execute docker pull xx.xx.xx.xx/xx/xx to download the image of the private library. The errors are as follows:

Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable

The reason is that docker supports HTTPS protocol by default, while the private library is HTTP protocol.

Mac desktop can be in preferences – & gt; Configure the following code in docker engine. Xx.xx.xx.xx is the address of your private library.

{
    "insecure-registries":[
        "xx.xx.xx.xx"
    ]
}

CentOS system, modify/etc/docker/daemon.json, and add the following code.

{
    "insecure-registries":[
        "xx.xx.xx.xx"
    ]
}

Add here

ERROR: Rancher must be ran with the –privileged flag when running outside of Kubernetes

According to the document on the official website of rancher 2.4, only one Linux host is required. Remember that a single node rancher server can be quickly deployed. Of course, this can only be used for testing. Deployment is very convenient. Just start dcoker on the host, and then start a container:

sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher

After the test, it is found that the container is constantly restarted after startup, and there is no way to enter the UI, prompting a network error.

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                         PORTS               NAMES
bfd5c52a1ce7        rancher/rancher     "entrypoint.sh"     12 hours ago        Restarting (1) 3 seconds ago                       elated_heisenberg

View log:

[root@k8s-node02 ~]# docker logs --tail 3 bfd5c52a1ce7
ERROR: Rancher must be ran with the --privileged flag when running outside of Kubernetes
ERROR: Rancher must be ran with the --privileged flag when running outside of Kubernetes
ERROR: Rancher must be ran with the --privileged flag when running outside of Kubernetes

If an error is found, it is said that — privileged is required to increase privileges
turn off the lifting appliance — privileged to try:

docker run -d --restart=unless-stopped --privileged  -p 80:80  -p 443:443 rancher/rancher

Found it

[Solved] System.InvalidOperationException: Failed to deploy distro docker-desktop……

Question

I am a win10 system and installed the docker desktop version. One day after I uninstalled Lenovo housekeeper, docker could not be started normally. The error is as follows:



Error reporting details:

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\user\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: �~�~�p f\hV-N�l	g�fY�v�~�~�p�S(u0

	
 stderr: 
   在 Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) 位置 C:\workspaces\master-merge\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:行号 146
   在 Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() 位置 C:\workspaces\master-merge\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:行号 168
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() 位置 C:\workspaces\master-merge\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:行号 77
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__28.MoveNext() 位置 C:\workspaces\master-merge\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:行号 180
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() 位置 C:\workspaces\master-merge\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:行号 29
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() 位置 C:\workspaces\master-merge\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:行号 67
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() 位置 C:\workspaces\master-merge\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:行号 92

Solution

1. Attempt to uninstall and reinstall is invalid

2. Close WSL 2-based engine, restart and restore to normal

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed [Solved]

1. Problem phenomenon

Error reported by Ubuntu machine or docker container

Traceback (most recent call last):
  File "main.py", line 200, in <module>
  File "attribute_extract/extract_attribute.py", line 37, in __init__
  File "attribute_extract/models.py", line 25, in __init__
  File "torchvision/models/resnet.py", line 199, in resnet50
  File "torch/hub.py", line 433, in load_state_dict_from_url
  File "torch/hub.py", line 349, in _download_url_to_file
  File "urllib/request.py", line 162, in urlopen
  File "urllib/request.py", line 465, in open
  File "urllib/request.py", line 483, in _open
  File "urllib/request.py", line 443, in _call_chain
  File "urllib/request.py", line 1286, in https_open
  File "urllib/request.py", line 1245, in do_open
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)>

2. Solutions

sudo apt-get update 
sudo apt-get install ca-certificates
sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs

Error response from daemon: OCI runtime exec failed: exec failed: container_linux.go:345:

        An error was reported when using docker to enter the specified container today. The screenshot of the error is as follows:

        After careful verification, the command is correct, but it can’t get into the container. After checking the data, it is realized that there is a problem with the docker. It can be understood in combination with the error report:

Error response from daemon: OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown

        The above is complete error reporting information, of which the key information is as follows:

"/bin/bash\": stat /bin/bash: no such file or directory": unknown

        That is, there is no directory/bin/bash, so an error will be reported when you want to enter the container according to the initial command.

        You can enter by using the following command. The screenshot is as follows:

docker exec -it mqtt /bin/sh

      Perfect solution, record notes!

 

docker service Failed to get D-Bus connection: Operation not permitted

[hadoop@hadoop03 fastdfs-docker]$ sudo docker run -d --privileged=true  a:v1
2be67a4f7e63d5277fc7bea8ca46946e40d526f93bc634166826de2bd5179554
[hadoop@hadoop03 fastdfs-docker]$ sudo docker exec -it 2b bash
[root@2be67a4f7e63 /]# service keepalived start
Redirecting to /bin/systemctl start keepalived.service
Failed to get D-Bus connection: Operation not permitted
[root@2be67a4f7e63 /]# exit
exit
[hadoop@hadoop03 fastdfs-docker]$ sudo docker stop 2b
2b
[hadoop@hadoop03 fastdfs-docker]$ sudo docker rm 2b
2b

Create a container and start with/usr/SBIN/init

######################
[hadoop@hadoop03 fastdfs-docker]$ sudo docker run -d --privileged=true  a:v1 /usr/sbin/init
2dfab2702a180537f58549457fd5993bb0ee3e6e2da72e0672af58d922286ffd
[hadoop@hadoop03 fastdfs-docker]$ sudo docker exec -it 2d bash
[root@2dfab2702a18 /]# service keepalived start

Redirecting to /bin/systemctl start keepalived.service
[root@2dfab2702a18 /]#
[root@2dfab2702a18 /]# service keepalived status
Redirecting to /bin/systemctl status keepalived.service
● keepalived.service - LVS and VRRP High Availability Monitor
   Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2021-10-08 06:26:55 UTC; 4s ago
  Process: 250 ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 251 (keepalived)
   CGroup: /docker/2dfab2702a180537f58549457fd5993bb0ee3e6e2da72e0672af58d922286ffd/system.slice/keepalived.service
           └─251 /usr/sbin/keepalived -D
           ‣ 251 /usr/sbin/keepalived -D

Oct 08 06:26:55 2dfab2702a18 systemd[1]: Started LVS and VRRP High Availability Monitor.
Oct 08 06:26:55 2dfab2702a18 Keepalived_vrrp[253]: Unable to load module xt_set - not using ipsets
Oct 08 06:26:55 2dfab2702a18 Keepalived_vrrp[253]: VRRP_Instance(VI_1) removing protocol VIPs.
Oct 08 06:26:55 2dfab2702a18 Keepalived_vrrp[253]: VRRP_Instance(VI_1) removing protocol iptable drop rule
Oct 08 06:26:55 2dfab2702a18 Keepalived_vrrp[253]: Using LinkWatch kernel netlink reflector...
Oct 08 06:26:55 2dfab2702a18 Keepalived_vrrp[253]: VRRP_Instance(VI_1) Entering BACKUP STATE
Oct 08 06:26:55 2dfab2702a18 Keepalived_vrrp[253]: VRRP sockpool: [ifindex(447), proto(112), unicast(0), fd(10,11)]
Oct 08 06:26:55 2dfab2702a18 Keepalived[251]: Keepalived_healthcheckers exited with permanent error FATAL. Terminating
Oct 08 06:26:55 2dfab2702a18 Keepalived[251]: Stopping
Oct 08 06:26:56 2dfab2702a18 Keepalived_vrrp[253]: Stopped
[root@2dfab2702a18 /]#

Docker: How to Solve MYSQL8 & Navicat remote connection error

1. Download Image

docker pull mysql:8.0.26

2. Operation container

docker run -p 3306:3306 --restart=always -e MYSQL_ROOT_PASSWORD=ang123 --name mysql -d mysql:8.0.26

3. At this time, an error will be reported when using Navicat to log in, because the encryption methods of mysql8 and 5 are different, and the encryption method needs to be modified

4. Enter MySQL container

docker exec -it mysql bash

5. Log in to MySQL and modify the encryption method

mysql -uroot -pang123;

use mysql;

#Modify encryption method
alter user 'root'@'%' identified with mysql_native_password by 'root';

#View modified data
select host,user,plugin from user;

Revised as follows:

6.At this time, the local Navicat remote connection to MySQL in Linux still reports an error 1045, but the password is correct, and the grant authorization does not solve the problem

The final solution is as follows. Just change the password again. The password is still the original password

ALTER USER 'root'@'%' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY 'ang123';

#Make changes effective
flush privileges;

7. At this time, Navicat can be used for remote connection