In this session, we will install and setup docker in a simple and easy way on Amazon Linux 2.
Launch a EC2 instance (Amazon Linux AMI)
Ensure to allow port 80 on your Security group
Login to the server via SSH to the server using the public DNS and the public key
$ ssh -i <<keypair>.pem ec2-user@<FQDN of the server>
$ sudo yum update -y
$ sudo yum install -y docker
$ sudo service docker start
$ sudo usermod -aG docker ec2-user
$ exit
ssh -i <<keypair>.pem ec2-user@<FQDN of the server>
$ docker info
Containers: 11
Running: 0
Paused: 0
Stopped: 11
Images: 2
Server Version: 18.06.1-ce
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 macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.14.114-105.126.amzn2.x86_64
Operating System: Amazon Linux 2
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.945GiB
Name: ip-172-31-31-158.ec2.internal
ID: 2QKP:NDTO:37EM:ERY6:2HUZ:WNPV:N45U:4ZBW:6VK7:NRDI:CLVN:7WLU
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false