安装


  1. $ sudo pacman -S docker

将用户添加到用户组


  1. $ sudo groupadd docker //添加docker用户组,没有则添加
  2. $ sudo gpasswd -a $USER docker //将登录用户添加到docker用户组
  3. $ newgrp docker //更新docker用户组

修改docker镜像,与镜像位置


docker修改镜像位置与镜像源位置在/etc/docker/daemon.json中
  1. $ sudo vim /etc/docker/daemon.json
  2. {
  3. "registry-mirrors": ["镜像源地址"], //地址选择自己使用最快的镜像站源
  4. "graph": "/home/$USER/.docker/image" //自定义镜像路径
  5. }

设置docker开机自启


  1. $ sudo systemctl enable docker //设置开机启动
  2. $ sudo systemctl start docker //启动docker

查看配置情况


  1. $ docker info

如果输出类似下面内容则配置成功
  1. Client:
  2. Debug Mode: false
  3. Server:
  4. Containers: 2
  5. Running: 0
  6. Paused: 0
  7. Stopped: 2
  8. Images: 29
  9. Server Version: 19.03.11-ce
  10. Storage Driver: overlay2
  11. Backing Filesystem: xfs
  12. Supports d_type: true
  13. Native Overlay Diff: false
  14. Logging Driver: json-file
  15. Cgroup Driver: cgroupfs
  16. Plugins:
  17. Volume: local
  18. Network: bridge host ipvlan macvlan null overlay
  19. Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
  20. Swarm: inactive
  21. Runtimes: runc
  22. Default Runtime: runc
  23. Init Binary: docker-init
  24. containerd version:
  25. runc version:
  26. init version:
  27. Security Options:
  28. seccomp
  29. Profile: default
  30. Kernel Version: 5.7.0-1-MANJARO
  31. Operating System: Manjaro Linux
  32. OSType: linux
  33. Architecture: x86_64
  34. CPUs: 8
  35. Total Memory: 15.53GiB
  36. Name: PC
  37. ID:
  38. Docker Root Dir: //your path
  39. Debug Mode: false
  40. Registry: https://index.docker.io/v1/
  41. Labels:
  42. Experimental: false
  43. Insecure Registries:
  44. 127.0.0.0/8
  45. Registry Mirrors:
  46. //your registry
  47. Live Restore Enabled: false