Skip to content

Instantly share code, notes, and snippets.

@suzukiken
Created March 26, 2021 07:15
Show Gist options
  • Save suzukiken/a5f038d629f856b478c48b01176d2481 to your computer and use it in GitHub Desktop.
Save suzukiken/a5f038d629f856b478c48b01176d2481 to your computer and use it in GitHub Desktop.
run webserver on cloud9
mkdir html
cat >html/index.html <<-EOF
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
こんにちは
</body>
</html>
EOF
sudo docker run --name webserver -p 80:80 -v /home/ec2-user/environment/html:/usr/share/nginx/html:ro -d nginx
IPADDRESS=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
echo http://$IPADDRESS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment