美文网首页
Running Docker Containers with S

Running Docker Containers with S

作者: allenhaozi | 来源:发表于2020-09-06 11:50 被阅读0次
    [Unit]
    Description=Redis Container
    After=docker.service
    Requires=docker.service
    
    [Service]
    TimeoutStartSec=0
    Restart=always
    ExecStartPre=-/usr/bin/docker stop %n
    ExecStartPre=-/usr/bin/docker rm %n
    ExecStartPre=/usr/bin/docker pull redis
    ExecStart=/usr/bin/docker run --rm --name %n redis
    
    [Install]
    WantedBy=multi-user.target
    

    https://blog.marcnuri.com/docker-container-as-linux-system-service/
    https://blog.container-solutions.com/running-docker-containers-with-systemd

    相关文章

      网友评论

          本文标题:Running Docker Containers with S

          本文链接:https://www.haomeiwen.com/subject/uchcektx.html