How to stop docker under Linux

前端 未结 3 545
北荒
北荒 2021-01-30 01:44

My version of OS Ubuntu 16.04. I want to stop docker, so I run in the terminal:

sudo systemctl stop docker

But this commands doesn

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 02:07

    The output of ps aux looks like you did not start docker through systemd/systemctl.

    It looks like you started it with:

    sudo dockerd -H gridsim1103:2376
    

    When you try to stop it with systemctl, nothing should happen as the resulting dockerd process is not controlled by systemd. So the behavior you see is expected.

    The correct way to start docker is to use systemd/systemctl:

    systemctl enable docker
    systemctl start docker
    

    After this, docker should start on system start.

    EDIT: As you already have the docker process running, simply kill it by pressing CTRL+C on the terminal you started it. Or send a kill signal to the process.

提交回复
热议问题