Including docker-nginx port forwarding on AWS Linux 2

AWS Linux2 Create a new EC2 instance

Reference

Docker installation

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

install / start nginx

$ docker pull nginx
$ docker run -d --name nginx-container -p 8080:80 nginx

Browser connection to nginx

Firewall transparency on AWS

Set the following in the security group

out.png in.png

What I'm doing is port forwarding, so The port is open.

Browser connection

The connection URL is http: // AWS instance IP: 8080 /

nginx.png

Supplement-Docker execution confirmation command

$ 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

Including docker-nginx port forwarding on AWS Linux 2
Linux ssh port forwarding (tunnel) settings
[Linux] Review of commands for deploying on AWS
UDP port forwarding
Jupyter on AWS
[AWS CLI] Enable the AWS CLI on Red Hat Enterprise Linux 8
MySQL installation on Aws Linux 2 and test data preparation
[AWS EC2] How to install Maven on Amazon Linux 2
[AWS] How to expand disk space on Amazon linux
jblas on Arch Linux
NAT router on Linux
About WOL port forwarding
Develop .NET on Linux
Wake on lan on Linux
Monitor traffic on Linux
Update vscode on linux
Install Docker on AWS
Try NeosVR on Linux
Check capacity on Linux
LiveUSB creation on Linux
Linux operation on Win10
Intuitive password management with aws ssm on Mac / Linux alias