-
[Docker] Docker NetworkingCloud/Openstack_K8s_Docker 2021. 2. 24. 18:51
<NAT configuration for connection from external>
1. Starting Nginx
root@ubuntu:~# sudo docker run --name web1 -d -p 8080:80 nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
45b42c59be33: Pull complete
8acc495f1d91: Pull complete
ec3bd7de90d7: Pull complete
19e2441aeeab: Pull complete
f5a38c5f8d4e: Pull complete
83500d851118: Pull complete
Digest: sha256:f3693fe50d5b1df1ecd315d54813a77afd56b0245a404055a946574deb6b34fc
Status: Downloaded newer image for nginx:latest
0c17d2e0b769207b86c0633b56a063f79ea5656fbfe18030908aaa75307a1ed8
root@ubuntu:~#2. Verification to running Nginx
root@ubuntu:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0c17d2e0b769 nginx "/docker-entrypoint.…" About a minute ago Up About a minute 0.0.0.0:8080->80/tcp web1
4d04a4fe6344 onosproject/onos "./bin/onos-service …" About an hour ago Up About an hour 6640/tcp, 9876/tcp, 0.0.0.0:1653->6653/tcp, 0.0.0.0:1101->8101/tcp, 0.0.0.0:1181->8181/tcp onos1
9472a0ed0e7c alpine "/bin/sh" 2 hours ago Up 2 hours container2
4a5e28dbd82d alpine "/bin/sh" 2 hours ago Up 2 hours container1
root@ubuntu:~#root@ubuntu:~# docker network inspect bridge
[
{
"Name": "bridge",
"Id": "844810ed51d3c3122a9efe4cacd9201cac83f58b30edfe0a413610bbed54fc67",
"Created": "2021-02-24T15:26:39.636855738+08:00",
"Scope": "local",
....
...
..
.
"ConfigOnly": false,
"Containers": {
"0c17d2e0b769207b86c0633b56a063f79ea5656fbfe18030908aaa75307a1ed8": {
"Name": "web1",
"EndpointID": "51de1dde402d1756a3b081e6c5316b47ab14abb6d61061bdf9d51b0641608ca7",
"MacAddress": "02:42:ac:11:00:05",
"IPv4Address": "172.17.0.5/16",
"IPv6Address": ""
},root@ubuntu:~# curl 127.0.0.1:8080
3. WebGUI access to Nginx
Port Forwarding
'Cloud > Openstack_K8s_Docker' 카테고리의 다른 글
[Rancher] Installation on Ubuntu 16.04 - 1 (0) 2021.03.10 [ONOS] Connecting ONOS to OvS (0) 2021.02.24 [ONOS] Installation on Ubuntu16 (0) 2021.02.24 [Docker] Connecting two containers via OVS (0) 2021.02.24 [Docker] installation on Ubuntu 16.04.7 LTS (0) 2021.02.24