使用 Docker 安装 XXX

BBigSun 评论210阅读模式

官方镜像网址:https://hub.docker.com/search?q=

1、使用 Docker 安装 Ubuntu

docker run -itd --name ubuntu ubuntu

进入 Ubuntu:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it ubuntu bash


2、使用 Docker 安装 CentOS

docker run -itd --name centos centos:centos7

进入 CentOS:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it centos bash


3、使用 Docker 安装 Nginx

docker run -itd --name nginx -p 80:80 nginx

进入 Nginx:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it nginx bash


4、使用 Docker 安装 Nodejs

docker run -itd --name node node

进入 Nodejs:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it node bash


5、使用 Docker 安装 PHP

docker run --name  php -d php:5.6-fpm

进入 PHP:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it php bash


6、使用 Docker 安装 MySQL

docker run -itd --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql

进入 MySQL:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it mysql bash


7、使用 Docker 安装 Tomcat

docker run -it --name tomcat -p 8888:8080 tomcat:9.0

进入 tomcat:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it tomcat bash


8、使用 Docker 安装 Python

docker run -itd --name python  python:3

进入 python:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it python bash


9、使用 Docker 安装 Redis

docker run -itd --name redis -p 6379:6379 redis

进入 python:文章源自十年又十年-https://www.bbigsun.com/295.html

docker exec -it redis bash


10、使用 Docker 安装 MongoDB

docker run -itd --name mongo -p 27017:27017 mongo --auth

进入 python:文章源自十年又十年-https://www.bbigsun.com/295.html

$ docker exec -it mongo mongo admin
# 创建一个名为 admin,密码为 123456 的用户。
>  db.createUser({ user:'admin',pwd:'123456',roles:[ { role:'userAdminAnyDatabase', db: 'admin'},"readWriteAnyDatabase"]});
# 尝试使用上面创建的用户信息进行连接。
> db.auth('admin', '123456')

纸上得来终觉浅,绝知此事要躬行。

weinxin
17688689121
我的微信
微信扫一扫
Docker最后更新:2024-5-11
BBigSun
  • 本文由 BBigSun 发表于 2023年 2月 20日 11:48:57
  • 转载请务必保留本文链接:https://www.bbigsun.com/295.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定