上文中 docker安装篇中 已经安装并测试好了docker ,本文开始使用docker
如果想具体配置docker
请到https://docs.docker.com/config/daemon/ 你懂得

本文上接 前文的 环境,不在赘述.

测试运行

  1. [root@redis01 ~]# docker run hello-world
  2. Unable to find image 'hello-world:latest' locally
  3. latest: Pulling from library/hello-world
  4. 1b930d010525: Pull complete
  5. Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
  6. Status: Downloaded newer image for hello-world:latest
  7. Hello from Docker!
  8. This message shows that your installation appears to be working correctly.

[root@redis01 ~]# yum -y install bash-completion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base: mirrors.aliyun.com
extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Resolving Dependencies
—> Running transaction check
—-> Package bash-completion.noarch 1:2.1-6.el7 will be installed
—> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================
Package Arch Version Repository Size
==============================================================================================
Installing:
bash-completion noarch 1:2.1-6.el7 base 85 k
Transaction Summary
==============================================================================================
Install 1 Package
Total download size: 85 k
Installed size: 259 k
Downloading packages:
bash-completion-2.1-6.el7.noarch.rpm | 85 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:bash-completion-2.1-6.el7.noarch 1/1
Verifying : 1:bash-completion-2.1-6.el7.noarch 1/1
Installed:
bash-completion.noarch 1:2.1-6.el7
Complete!
[root@redis01 ~]# curl https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker -o /etc/bash_completion.d/docker.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 107k 100 107k 0 0 37927 0 0:00:02 0:00:02 —:—:— 37928
[root@redis01 ~]#

安装docker自动补全

不然难受~~

  1. # 安装bash补全
  2. [root@redis01 ~]# yum -y install bash-completion
  3. # 下载并运行docker补全脚本
  4. [root@redis01 ~]# curl https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/docker -o /etc/bash_completion.d/docker.sh
  5. # 注销重新登录
  6. [root@redis01 ~]# logout

参考:https://medium.com/@ismailyenigul/enable-docker-command-line-auto-completion-in-bash-on-centos-ubuntu-5f1ac999a8a6

[root@redis01 ~]# docker container
attach create export logs port restart start top wait
commit diff inspect ls prune rm stats unpause
cp exec kill pause rename run stop update
[root@redis01 ~]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@redis01 ~]# docker container ls —all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
acbf3df3287e hello-world “/hello” 2 hours ago Exited (0) 2 hours ago upbeat_driscoll
[root@redis01 ~]#

all的静默模式

  1. [root@redis01 ~]# docker container ls -aq
  2. acbf3df3287e

https://www.daocloud.io/mirror#accelerator-doc

https://www.cnblogs.com/pyyu/p/6925606.html
#一条命令加速
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://95822026.m.daocloud.io

https://github.com/docker/labs docker 学习教程