名称 IP地址 用户名 密码
阿里云IP 112.74.84.17 root Hlf123456
宝塔面板IP http://112.74.84.17:8888//hlf6666 Hlf Hlf123456
本机Linux 192.168.204.128 root 123456
Mysql/Redis 112.74.84.17 root 123456

1.关闭和禁用防火墙
service iptables stop 暂停
chkconfig iptables off 永久关闭
service iptables status 检查状态

安装软件需要开发对应端口号

二、常用docker命令:

01.启动容器【启动已经创建的】

docker start 容器id/容器名

02.重启容器【重启已经创建的】

docker restart 容器id/容器名

03.停止容器

docker stop 容器id/容器名 温柔停止
docker kill 容器id/容器名 强制停止容器【拔电源】

04.删除以停止的容器

docker rm 容器ID
-f 强制删除

05.一次性删除多个容器

docker rm -f ${docker ps -a -q}
docker ps -a -q | xargs docker rm

06.删除镜像

docker rmi 镜像名字

-f 表示强制删除,如果镜像运行了,那么就需要-f 强制删除

删除单个:docker rmi -f 镜像
删除多个:docker rmi -f 镜像名1:tag 镜像名2:tag
删除全部:docker rmi -f ${docker images -qa}

07.拉取镜像到本地

docker pull 镜像名字:tag

tag可省略,默认最新版 latest

08.列出本地的镜像

docker images

09.docker设置镜像自动启动

查看所有安装的镜像

  1. [root@localhost ~]# docker ps -a
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
  3. cef8c24d12fe logstash:5.6.15 "/docker-entrypoint.…" 16 hours ago Exited (255) 13 minutes ago 0.0.0.0:4560->4560/tcp
  4. e1154d32d3f5 kibana:5.6.11 "/docker-entrypoint.…" 16 hours ago Exited (255) 13 minutes ago
  5. e886a3267652 elasticsearch:5.6.11 "/docker-entrypoint.…" 16 hours ago Exited (255) 13 minutes ago
  6. ee113699fb16 zookeeper "/docker-entrypoint.…" 46 hours ago Exited (255) 13 minutes ago 2888/tcp, 3888/tcp, 0.

设置总是自动启动

  1. [root@localhost ~]# docker update cef8c24d12fe --restart=always
  2. cef8c24d12fe
  3. [root@localhost ~]# docker update e1154d32d3f5 --restart=always
  4. e1154d32d3f5
  5. [root@localhost ~]# docker update e886a3267652 --restart=always
  6. e886a3267652
  7. [root@localhost ~]# docker update ee113699fb16 --restart=always
  8. ee113699fb16

联系git网站https://_learngitbranching_.js.org/