# MySQL 限制0.5个CPU和0.5G内存
docker pull mysql:5.7
docker run -itd --name mysql -p3306 --cpu-period=1000000 --cpu-quota=500000 --memory 512M --rm -e MYSQL_ROOT_PASSWORD=root mysql:5.7
# 本地连接
docker exec -it mysql mysql -h localhost -u root -proot
# 远程连接
mysql -uroot -h172.17.0.2 -P3306 -proot performance_schema
# Redis
docker pull redis:7.0
docker run --name redis --rm -itd redis:7.0
docker exec -it redis redis-cli
# 查看所有的key
keys *
# 写入键值对
set 1 "1"
# ZooKeeper
docker pull zookeeper:3.8
docker run --name zk -u root -itd zookeeper:3.8
# 确认zk的2181端口已开放
nsenter -n -t `docker inspect 1a08325349 --format "{{.State.Pid}}"` lsof -i:2181
# CentOS
docker run --privileged=true -itd centos:7.6.1810 bash
标签:run,启动,--,itd,常见,redis,mysql,docker From: https://www.cnblogs.com/WJQ2017/p/17738670.html