AWS Official Docker Installation Manual
Although it is in the manual, only the commands are listed for the time being.
$ sudo yum update -y
$ sudo amazon-linux-extras install docker
$ sudo service docker start
$ sudo usermod -a -G docker ec2-user
$ docker pull nginx
$ docker run -d --name nginx-container -p 8080:80 nginx
Set the following in the security group
What I'm doing is port forwarding, so The port is open.
The connection URL is http: // AWS instance IP: 8080 /
$ docker ps -a
$ docker images
$docker stop connection ID
$docker rm connection ID
#Connect to docker
$ docker exec -it connection ID/bin/bash
#IP of connected docker
$ root@Connection ID:/# hostname -i
Recommended Posts