Docker是基于Go语言实现的容器引擎。
解决运行环境和开发环境不同造成的问题。
Docker分为DockerCE社区版和DockerEE企业版。
Docker 由镜像、容器、远程镜像仓库。
容器化技术和虚拟化技术差别:
Docker 安装:
官方文档: https://docs.docker.com/install/linux/docker-ce/centos/
基于CentOS 7 (3.10.0-1062.el7.x86_64)
#yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 #yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo #yum install docker-ce docker-ce-cli containerd.io默认安装最新版本,当前安装版本:
# 启动docker # systemctl start docker
# 关闭docker # systemctl stop docker
查看docker信息
# docker version Client: Docker Engine - Community Version: 19.03.5 API version: 1.40 Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:25:41 2019 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 19.03.5 API version: 1.40 (minimum version 1.12) Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:24:18 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683
# docker info Client: Debug Mode: false Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 19.03.5 Storage Driver: overlay2 Backing Filesystem: xfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 3.10.0-1062.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 3.682GiB Name: localhost.localdomain ID: LRYC:CF3G:SENH:SRST:23MD:CRAA:LQMI:SBKB:R6OR:O4J3:XL6F:B7AN Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false
# 设置docker开机启动 # systemctl enable docker
卸载Docker:
# yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
Docker rpm 安装包下载地址: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/