docker 启动常用容器命令

常用命令链接:https://www.runoob.com/docker/docker-command-manual.html

# 启动redis

docker pull redis


docker run --name redis1 -p 6379:6379 -d redis --requirepass 密码

docker run --name redis -p 6379:6379 -d redis --requirepass pwd123

# 启动postgres  参考 https://blog.csdn.net/adam309050449/article/details/106362926

docker pull postgres

docker run --name postgres -e POSTGRES_PASSWORD=123 -p hostPort:containerPort -d postgres

#进入容器

docker exec -it <containerID> psql -h <postgresqlIp> -U postgres
原文地址:https://www.cnblogs.com/chen-msg/p/14145193.html