在docker启动之后,自动连接redis和mysql

[vagrant@localhost ~]$
[vagrant@localhost ~]$ sudo docker update redis --restart=always
redis
[vagrant@localhost ~]$
[vagrant@localhost ~]$
[vagrant@localhost ~]$
[vagrant@localhost ~]$ sudo docker update mysql --restart=always
mysql
[vagrant@localhost ~]$
[vagrant@localhost ~]$
[vagrant@localhost ~]$ Connection to 127.0.0.1 closed by remote host.
Connection to 127.0.0.1 closed.

D:\centos_vagrant>vagrant ssh
Last login: Thu Sep 10 10:01:30 2020 from 10.0.2.2
[vagrant@localhost ~]$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                          PORTS                               NAMES
b00aa84f39fc        redis               "docker-entrypoint.s…"   3 hours ago         Restarting (1) 34 seconds ago                                       redis
93aa946bdbe2        mysql:5.7           "docker-entrypoint.s…"   4 hours ago         Up About a minute               0.0.0.0:3306->3306/tcp, 33060/tcp   mysql
[vagrant@localhost ~]$

 

相关文章:

  • 2022-01-26
  • 2021-07-17
  • 2022-12-23
  • 2021-05-12
  • 2021-12-22
  • 2021-11-20
  • 2021-08-17
  • 2021-06-22
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2021-04-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案