zoukankan      html  css  js  c++  java
  • 在docker中设置redis和mysql自动启动

    在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 ~]$
  • 相关阅读:
    Portable Executable 可移植可执行
    汇编跳转指令
    Java中this和super
    Java成员变量和类变量
    EasyUI select
    JAVA虚函数
    感想
    函数
    ueditor
    gitlab简介配置和参数修改
  • 原文地址:https://www.cnblogs.com/ooo888ooo/p/13648540.html
Copyright © 2011-2022 走看看