This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
basic/[Ubuntu 16.04]可选设置 | ||
basic/hello-world | ||
basic/docker-hub使用 | ||
basic/[Ubuntu 16.04]docker启动设置 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
# [Ubuntu 16.04]docker启动设置 | ||
|
||
参考:[Control Docker with systemd](https://docs.docker.com/config/daemon/systemd/) | ||
|
||
使用命令`systemctl`或`service`实现`docker`守护进程的启动和关闭 | ||
|
||
## systemctl使用 | ||
|
||
查看`docker`状态 | ||
|
||
``` | ||
$ systemctl status docker | ||
● docker.service - Docker Application Container Engine | ||
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled) | ||
Active: inactive (dead) since 四 2019-09-19 19:13:51 CST; 3s ago | ||
Docs: https://docs.docker.com | ||
... | ||
... | ||
``` | ||
|
||
启动`docker` | ||
|
||
``` | ||
$ systemctl start docker | ||
``` | ||
|
||
关闭`docker` | ||
|
||
``` | ||
$ systemctl stop docker | ||
``` | ||
|
||
## service使用 | ||
|
||
查看`docker`状态 | ||
|
||
``` | ||
$ service docker status | ||
● docker.service - Docker Application Container Engine | ||
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled) | ||
Active: inactive (dead) since 四 2019-09-19 19:13:51 CST; 2min 51s ago | ||
Docs: https://docs.docker.com | ||
Main PID: 8263 (code=exited, status=0/SUCCESS) | ||
... | ||
... | ||
``` | ||
|
||
启动`docker` | ||
|
||
``` | ||
$ service docker start | ||
``` | ||
|
||
关闭`docker` | ||
|
||
``` | ||
$ service docker stop | ||
``` |