docker pull xxxx Pull the image
docker run -it xxxx /bin/bash Start the image
Start the docker service
docker ps Query the running container
docker ps -a Query all containers, including non-running
Mysql container startup: docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
Redis container startup: sudo docker run -p 6379:6379 --name redis -v /data/redis/redis.conf:/etc/redis/redis.conf -v /data/redis/data:/data - d redis redis-server /etc/redis/redis.conf --appendonly yes
docker restart container id
docker start container id
uname -r View kernel version
yum -y remove docker docker-common docker-selinux docker-engine Uninstall the old version of docker
yum install yum-utils device-mapper-persistent-data lvm2 -y Install dependencies
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo Set Alibaba Cloud mirror source
yum install docker -ce install docker-ce #ce is the Community Edition, ee is the enterprise edition
systemctl enable docker to start automatically after booting
systemctl start docker to manually start the docker container
docker --version Check whether docker started successfully
docker info Check docker information
The above is the detailed content of How to install docker container and pull mysql image on linux. For more information, please follow other related articles on the PHP Chinese website!