WildCat
V2EX  ›  问与答

Docker Container 自启动和 Container 内服务自启动的问题

  •  
  •   WildCat · Sep 22, 2014 · 7272 views
    This topic created in 4344 days ago, the information mentioned may be changed or developed.
    今天试了试把Ghost博客放在Docker里,但是遇到了很多问题:
    1. 在宿主机(VPS)里如何开机自动启动某个docker container(已知ID)?
    2. container启动时如何自动启动一些服务?我这里是想用forever启动Ghost博客

    试了很多种方法,都失败了。
    linux基础不好,为什么直接在 /etc/init.d/rc.local 内写启动命令不会被执行呢?
    2 replies    2014-09-22 16:08:19 +08:00
    hjc4869
        1
    hjc4869  
       Sep 22, 2014 via iPhone   ❤️ 1
    ghost不建议使用forever,推荐这样自启: https://hjc.im/you-ya-di-shi-ghostbo-ke-zai-vpsshang-bao-chi-yun-xing/
    hjc4869
        2
    hjc4869  
       Sep 22, 2014 via iPhone   ❤️ 1
    在rc.local里编辑时注意所有文件全都用完整路径,比图forever不能直接输入forever,要找到它的位置,如/usr/bin/forever。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2723 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 01:29 · PVG 09:29 · LAX 18:29 · JFK 21:29
    ♥ Do have faith in what you're doing.