docker: Error response from daemon: OCI runtime create failed: container_ linux. Go:380 error
Docker fails to run after installing mysql5.7, and reports error: OCI runtime create failed
Pull mysql5.7 on docker is OK
execute the code and report an error
docker run -p 3306:3306 --name mysql
-v /mydata/mysql/log:/var/log/mysql
-v /mydata/mysql/data:/var/lib/mysql
-v /mydata/mysql/conf:/etc/mysql
-e MYSQL_ ROOT_ PASSWORD=root
-d mysql:5.7
cd to /mydata/mysql/conf and finds that it is not mounted correctly, and there is no /etc/mysql file path
Reason for error: because of the compatibility between Linux and docker version, the docker version needs to be degraded or reinstalled
There are two solutions:
- Reinstall the specified version of docker
- Downgrade docker to the specified version
The first method: uninstall and reinstall:
//Step 1: Uninstall docker
//List the packages downloaded by docker
sudo yum list installed | grep docker
//remove all the above related installed packages sudo yum -y remove "above show related packages"
sudo yum -y remove docker-ce.x86_64
sudo yum -y remove docker-ce-cli.x86_64
// Remove related images and containers
sudo rm -rf /var/lib/docker
sudo yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-selinux
docker-engine-selinux
docker-engine
//Test for deletion
docker -v
// Step 2: reinstall the specified version of docker
// Install some necessary system tools.
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
// Add software source information: sudo yum-config -y
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
//Update the yum cache.
sudo yum makecache fast
//View the available versions of Docker-ce: sudo yum list docker-ce
yum list docker-ce --showduplicates | sort -r
// If you need to show only table versions, you can turn off the list for test versions: yum list
sudo yum-config-manager --enable docker-ce-edge
sudo yum-config-manager --enable docker-ce-test
//Update the yum package index
yum makecache fast
//Install the specified version of docker-ce: sudo yum install -y docker-ce
sudo yum install -y docker-ce-17.03.2.ce-1.el7.centos
// Error: If the installation of the specified version of docker shows that the specified version of the docker-ce-selinux dependency package needs to be installed, please install.
yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
Then pull MySQL again
docker pull mysql:5.7
The second method: downgrade docker to the specified version:
//stop docker
sudo systemctl stop docker
//Enter the downgrade command
yum downgrade --setopt=obsoletes=0 -y docker-ce-17.03.2.ce-1.el7 docker-ce-selinux-17.03.2.ce-1.el7 containerd.io
//Checking the docker version
docker -v
Recreate container and start
docker run -p 3306:3306 --name mysql
-v /mydata/mysql/log:/var/log/mysql
-v /mydata/mysql/data:/var/lib/mysql
-v /mydata/mysql/conf:/etc/mysql
-e MYSQL_ ROOT_ PASSWORD=root
-d mysql:5.7
Read More:
- [Solved] Error response from daemon: OCI runtime create failed: container with id exists: xxzxxxxxxxx
- [environment] docker: error response from daemon: OCI runtime
- Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl
- Docker Create or Start Nginx Error: docker: Error response from daemon: driver failed programming external connectivity
- Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen is reported when docker port mapping or starting the container
- [Solved] docker: Error response from daemon: driver failed programming external connectivity on endpoint mysql-test …
- Docker Create tomcat Error standard_init_linux.go:211: exec user process caused “no such file or directory”
- [Solved] Docker: Error response from daemon: driver failed programming external connectivity on endpoint mysq
- [Solved] Docker Error: Error response from daemon: driver failed programming external connectivity on endpoint
- Docker Error response from daemon: Get https://registry-1.docker.io/v2/portainer/portainer/…
- Docker Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate has expired or is not yet valid
- [Solved] Docker Error: got permission denied while trying to connect to the docker daemon socket at…
- Mac Docker pull Error: Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable
- How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket
- [Solved] Docker failed to start daemon: error initializing graphdriver: driver not supported
- Docker service startup error: Job for docker.service failed because the control process exited with error code.
- Docker Open Error: Warning: docker.service changed on disk. Run ‘systemctl daemon-reload‘ to reload unit
- [Solved] Error response from daemon: Get “*“: x509: certificate signed by unknown authority
- How to Solve Docker Run Error: standard_init_linux.go:219: exec user process caused: exec format error
- MAC: How to modify the docker container error [screen is terminating]