如何在AWS EC2 上安裝 Docker 環境
一、進入服務器後執行 yum install -y docker
[root@localhost ~]# yum install docker Loaded plugins: priorities, update-motd, upgrade-helper Resolving Dependencies --> Running transaction check ---> Package docker.x86_64 0:18.09.9ce-2.52.amzn1 will be installed --> Processing Dependency: runc = 1.0.0 for package: docker-18.09.9ce-2.52.amzn1.x86_64 --> Processing Dependency: containerd = 1.2.6 for package: docker-18.09.9ce-2.52.amzn1.x86_64 --> Processing Dependency: xfsprogs for package: docker-18.09.9ce-2.52.amzn1.x86_64 --> Processing Dependency: pigz for package: docker-18.09.9ce-2.52.amzn1.x86_64 --> Processing Dependency: libseccomp.so.2()(64bit) for package: docker-18.09.9ce-2.52.amzn1.x86_64 --> Running transaction check ---> Package containerd.x86_64 0:1.2.6-1.2.amzn1 will be installed ---> Package libseccomp.x86_64 0:2.3.1-2.4.amzn1 will be installed ---> Package pigz.x86_64 0:2.3.3-1.6.amzn1 will be installed ---> Package runc.x86_64 0:1.0.0-0.1.20190510.git2b18fe1.0.amzn1 will be installed ---> Package xfsprogs.x86_64 0:4.5.0-18.23.amzn1 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================== Package Arch Version Repository Size ==================================================================================== Installing: docker x86_64 18.09.9ce-2.52.amzn1 amzn-updates 35 M Installing for dependencies: containerd x86_64 1.2.6-1.2.amzn1 amzn-updates 26 M libseccomp x86_64 2.3.1-2.4.amzn1 amzn-main 79 k pigz x86_64 2.3.3-1.6.amzn1 amzn-main 71 k runc x86_64 1.0.0-0.1.20190510.git2b18fe1.0.amzn1 amzn-updates 2.3 M xfsprogs x86_64 4.5.0-18.23.amzn1 amzn-updates 1.7 M Transaction Summary ==================================================================================== Install 1 Package (+5 Dependent packages) Total download size: 65 M Installed size: 223 M Is this ok [y/d/N]: y Downloading packages: (1/6): libseccomp-2.3.1-2.4.amzn1.x86_64.rpm | 79 kB 00:00:00 (2/6): pigz-2.3.3-1.6.amzn1.x86_64.rpm | 71 kB 00:00:00 (3/6): runc-1.0.0-0.1.20190510.git2b18fe1.0.amzn1.x86_64.rpm | 2.3 MB 00:00:01 (4/6): containerd-1.2.6-1.2.amzn1.x86_64.rpm | 26 MB 00:00:03 (5/6): xfsprogs-4.5.0-18.23.amzn1.x86_64.rpm | 1.7 MB 00:00:00 (6/6): docker-18.09.9ce-2.52.amzn1.x86_64.rpm | 35 MB 00:00:05 ------------------------------------------------------------------------------------ Total 11 MB/s | 65 MB 00:00:05 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libseccomp-2.3.1-2.4.amzn1.x86_64 1/6 Installing : runc-1.0.0-0.1.20190510.git2b18fe1.0.amzn1.x86_64 2/6 Installing : containerd-1.2.6-1.2.amzn1.x86_64 3/6 Installing : pigz-2.3.3-1.6.amzn1.x86_64 4/6 Installing : xfsprogs-4.5.0-18.23.amzn1.x86_64 5/6 Installing : docker-18.09.9ce-2.52.amzn1.x86_64 6/6 Verifying : docker-18.09.9ce-2.52.amzn1.x86_64 1/6 Verifying : xfsprogs-4.5.0-18.23.amzn1.x86_64 2/6 Verifying : libseccomp-2.3.1-2.4.amzn1.x86_64 3/6 Verifying : containerd-1.2.6-1.2.amzn1.x86_64 4/6 Verifying : runc-1.0.0-0.1.20190510.git2b18fe1.0.amzn1.x86_64 5/6 Verifying : pigz-2.3.3-1.6.amzn1.x86_64 6/6 Installed: docker.x86_64 0:18.09.9ce-2.52.amzn1 Dependency Installed: containerd.x86_64 0:1.2.6-1.2.amzn1 libseccomp.x86_64 0:2.3.1-2.4.amzn1 pigz.x86_64 0:2.3.3-1.6.amzn1 runc.x86_64 0:1.0.0-0.1.20190510.git2b18fe1.0.amzn1 xfsprogs.x86_64 0:4.5.0-18.23.amzn1 Complete!
二、完成後進行啟動 docker
[root@localhost ~]# service docker start Starting cgconfig service: [ OK ] Starting docker: . [ OK ]
三、確認 docker 版本
[root@localhost ~]# docker version Client: Version: 18.09.9-ce API version: 1.39 Go version: go1.10.3 Git commit: 039a7df Built: Fri Nov 1 19:01:06 2019 OS/Arch: linux/amd64 Experimental: false Server: Engine: Version: 18.09.9-ce API version: 1.39 (minimum version 1.12) Go version: go1.10.3 Git commit: 039a7df Built: Fri Nov 1 19:02:42 2019 OS/Arch: linux/amd64 Experimental: false
完成 docker 環境架設