From e04713f83f4cf0c357ff134b054d54aa600a7b7f Mon Sep 17 00:00:00 2001 From: wangyu Date: Mon, 5 Oct 2020 21:37:05 +0800 Subject: [PATCH] assignment2 add docerk install --- Assignment2.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Assignment2.md b/Assignment2.md index 6a2ac6f..1a5a7b5 100644 --- a/Assignment2.md +++ b/Assignment2.md @@ -47,6 +47,38 @@ #### a) 安装docker +#### 推荐使用如下命令安装docker + +```bash +$ curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun +``` + +#### 按照提示将自己的用户加入docker的用户组(root 用户无需操作) + +```bash +$ sudo usermod -aG docker your-user +``` + +#### 基本的docker启动与查看状态命令如下 + +```bash +$ service docker start +$ service docker stop +$ service docker restart + +$ service docker status + +● docker.service - Docker Application Container Engine + Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) + Active: active (running) since Mon 2020-10-05 21:34:37 CST; 1min 45s ago + Docs: https://docs.docker.com + Main PID: 1954 (dockerd) + Tasks: 8 + Memory: 40.1M + CGroup: /system.slice/docker.service + └─1954 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock +``` + #### b) 测试Docker是否安装成功 #### 当你的按照上述步骤安装完docker之后,可以通过运行如下命令来测试docker是否安装成功