Home > Database > Mysql Tutorial > How to install docker container and pull mysql image on linux

How to install docker container and pull mysql image on linux

WBOY
Release: 2023-05-26 22:34:01
forward
1028 people have browsed it

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template