当前位置:   article > 正文

Linux 安装docker

Linux 安装docker

 安装docker

1.清楚系统残余项

命令:

  1. sudo yum remove docker \
  2. docker-client \
  3. docker-client-latest \
  4. docker-common \
  5. docker-latest \
  6. docker-latest-logrotate \
  7. docker-logrotate \
  8. docker-selinux \
  9. docker-engine-selinux \
  10. docker-engine

执行结果

2.安装下载Docker依赖的工具

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

执行结果:

 以后每个软件都优先从阿里云的软件库中下载,如果阿里云仓库没有,会去docker.hub中下载。(与maven仓库同理)

3.更新yum缓存(为了保证能更新和下载需要的服务:如dock

sudo yum makecache 

执行结果:

 4.安装Docker

sudo yum -y install docker-ce

执行结果:

看到完毕就代表安装成功了 

5.启动Dokcer服务

sudo systemctl start docker

以上我们已经将Docker安装好了,接下来测试下Docker是否可以顺利启动:

docker info

执行结果:

  1. Client:
  2. Context: default
  3. Debug Mode: false
  4. Plugins:
  5. app: Docker App (Docker Inc., v0.9.1-beta3)
  6. buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
  7. scan: Docker Scan (Docker Inc., v0.23.0)
  8. Server:
  9. Containers: 0
  10. Running: 0
  11. Paused: 0
  12. Stopped: 0
  13. Images: 0
  14. Server Version: 20.10.22
  15. Storage Driver: overlay2
  16. Backing Filesystem: xfs
  17. Supports d_type: true
  18. Native Overlay Diff: true
  19. userxattr: false
  20. Logging Driver: json-file
  21. Cgroup Driver: cgroupfs
  22. Cgroup Version: 1
  23. Plugins:
  24. Volume: local
  25. Network: bridge host ipvlan macvlan null overlay
  26. Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
  27. Swarm: inactive
  28. Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
  29. Default Runtime: runc
  30. Init Binary: docker-init
  31. containerd version: 78f51771157abb6c9ed224c22013cdf09962315d
  32. runc version: v1.1.4-0-g5fd4c4d
  33. init version: de40ad0
  34. Security Options:
  35. seccomp
  36. Profile: default
  37. Kernel Version: 3.10.0-1160.el7.x86_64
  38. Operating System: CentOS Linux 7 (Core)
  39. OSType: linux
  40. Architecture: x86_64
  41. CPUs: 4
  42. Total Memory: 1.777GiB
  43. Name: 192.168.73.128
  44. ID: U6HV:4B5S:FJ7Q:3O3K:ECJT:GDCZ:4OZF:K3JN:FAVX:TONC:YWOY:5XKV
  45. Docker Root Dir: /var/lib/docker
  46. Debug Mode: false
  47. Registry: https://index.docker.io/v1/
  48. Labels:
  49. Experimental: false
  50. Insecure Registries:
  51. 127.0.0.0/8
  52. Live Restore Enabled: false

6.设置开机自启

sudo systemctl enable docker

到这一步dokcer的安装已经全部完成了

7.查看当前Docker的版本

命令:

docker -v

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/160558
推荐阅读
相关标签
  

闽ICP备14008679号