https://www.runoob.com/docker/docker-tutorial.html
CentOS7:https://blog.csdn.net/qq_40794973/article/details/91484107
official
英 [əˈfɪʃl] 美 [əˈfɪʃl]
adj.公务的;公职的;公事的;正式的;官方的;官方授权的;公开的;公布的;据官方的
n.要员;官员;高级职员
docker images
docker search Xxx
https://hub.docker.com/search?type=image
创建指定
docker run \
--name redis \
-p 6379:6379 \
--restart always \
-di redis
后期修改
docker update redis --restart=always
https://www.runoob.com/docker/docker-install-mysql.html
查找Docker Hub上的Mysql镜像: https://hub.docker.com/_/mysql?tab=tag
docker pull mysql:5.6
docker pull mysql:8.0.18
宿主机端口:容器里面的mysql端口
docker run \
--name mysql \
--env MYSQL_ROOT_HOST=%.%.%.% \
--env MYSQL_ROOT_PASSWORD=123456 \
-p 3306:3306 \
-di mysql:8.0.18
http://www.apgblogs.com/docker-mysql/
mkdir -p /var/lib/mysql
docker run \
--name mysql \
--env MYSQL_ROOT_HOST=%.%.%.% \
--env MYSQL_ROOT_PASSWORD=123456 \
-v /var/lib/mysql:/var/lib/mysql \
-p 3306:3306 \
-d mysql:8.0.18
使用SQLyog可能会报1251的错;出错的原因可能是SQLyog版本过低不支持MySQL8的密码加密方式;可以使用IDEA连接MySQL就不会报这个错误了
jdbc:mysql://ip地址/数据库名?serverTimezone=UTC
- http://tomcat.apache.org/
- wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.50/bin/apache-tomcat-8.5.50.tar.gz
- wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.30/bin/apache-tomcat-9.0.30.tar.gz
查找 Docker Hub 上的 Tomcat 镜像: https://hub.docker.com/_/tomcat?tab=tags
docker pull tomcat
docker pull tomcat:7-jre7
docker run -di --name=mytomcat -p 80:8080 -v /usr/local/webapps:/usr/local/tomcat/webapps tomcat:latest
docker run -di --name=cat -p 80:8080 tomcat:latest
- 检查防火墙
- 检查服务器外层是否开放对应的端口
- 检查容器里面的webapps是否是空目录
[root@iZwz914dte0qtzcy55kabtZ ~]# docker exec -it cat /bin/bash
root@23865d5384a9:/usr/local/tomcat# ls
BUILDING.txt LICENSE README.md RUNNING.txt conf lib native-jni-lib webapps work
CONTRIBUTING.md NOTICE RELEASE-NOTES bin include logs temp webapps.dist
root@23865d5384a9:/usr/local/tomcat# ls webapps
root@23865d5384a9:/usr/local/tomcat# cp -r webapps.dist/. webapps
root@23865d5384a9:/usr/local/tomcat# ls webapps
ROOT docs examples host-manager manager
https://www.runoob.com/docker/docker-install-nginx.html
访问 Nginx 镜像库地址: https://hub.docker.com/_/nginx?tab=tags
docker pull nginx
docker run -di --name=mynginx -p 80:80 nginx
# 关闭前面创建的tomcat容器
docker stop mytomcat
# 创建nginx容器
docker run -di --name=mynginx -p 80:80 nginx
docker 镜像reids 默认 无配置文件启动
- Redis入门:https://yuanyu.blog.csdn.net/article/details/90606484
- Linux_YUM:https://blog.csdn.net/qq_40794973/article/details/89205347#t2
https://www.runoob.com/docker/docker-install-redis.html
访问 Redis 镜像库地址: https://hub.docker.com/_/redis?tab=tags
docker pull redis
docker run \
--name redis \
-p 6379:6379 \
-di redis
docker run \
--name redis \
-p 6379:6379 \
-di redis \
--requirepass "admin"
docker exec -it myredis /bin/bash
# 没有redis.conf文件
# redis容器里边的配置文件是需要在创建容器时映射进来的
cd /etc;ls
# 退出容器
exit
# 停止并删除创建的容器
docker ps
docker stop myredis
docker rm myredis
# 映射配置文件(拷贝官方配置文件在修改)
mkdir -p /usr/local/redis
vim /usr/local/redis/redis.conf
# 映射数据目录
mkdir -p /root/usr/local/redis/data
如果想要通过配置文件的方式启动redis,需要在redis.conf中注掉daemonize yes这一行
https://www.jianshu.com/p/923eb2e0a5f0
redis-5.0.7 redis.conf
bind 127.0.0.1
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize no
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile ""
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
replica-priority 100
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
# 设置 Redis 连接密码,如果配置了连接密码,客户端在连接 Redis 时需要通过 AUTH 命令提供密码,默认关闭
requirepass admin
# 绑定的主机地址
bind 0.0.0.0
# Redis 默认不是以守护进程的方式运行,可以通过该配置项修改,使用 yes 启用守护进程(Windows 不支持守护线程的配置为 no )
daemonize no
docker run -p 8848:6379 -itd --name myredis -v /usr/local/redis/redis.conf:/etc/redis/redis.conf -v /root/usr/local/redis/data:/data redis redis-server /etc/redis/redis.conf --appendonly yes
- -v /usr/local/redis/redis.conf:/etc/redis.conf:映射配置文件
- -v /root/usr/local/redis/data:/data:映射数据目录
- redis-server /etc/redis/redis.conf:redis 将以 /etc/redis/redis.conf 为配置文件启动
- --appendonly yes:开启redis 持久化
docker search activemq
docker pull docker.io/webcenter/activemq
docker run --name activemq -p 61616:61616 -p 8161:8161 -e ACTIVEMQ_ADMIN_LOGIN=admin -e ACTIVEMQ_ADMIN_PASSWORD=123456 --restart=always -d docker.io/webcenter/activemq
docker run --name='activemq' -d --rm -p 61616:61616 -p 8161:8161 webcenter/activemq:latest
- -p 61616:61616 容器使用端口映射
- -p 8161:8161 web页面管理端口映射
- -e ACTIVEMQ_ADMIN_LOGIN 设置登陆账号
- -e ACTIVEMQ_ADMIN_PASSWORD 设置登陆密码
- --rm 容器停止掉就删除这个容器
- https://www.rabbitmq.com/download.html
- https://registry.hub.docker.com/_/rabbitmq
docker pull rabbitmq:management
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:management
默认的登录账户用户名和密码都guest
http://ip:15672/
https://blog.csdn.net/fangkang7/article/details/100642695
https://blog.csdn.net/yscoder/article/details/100576958