Get the IP address of a container
Map ports to a container
docker build -t pythonimg .
docker run -d -p 8888:8000 --name "pythoncontainer" pythonimg
docker exec pythoncontainer ip a
docker exec pythoncontainer cat /proc/net/fib_trie | grep 172.17.0.|tail -n1
docker ps
docker container inspect pythoncontainer
links http://localhost:8888 ; links http://172.17.0.3:8000
docker run -d -P --name "pythoncontainer2" pythonimg
Dockerfile:
FROM python:alpine
RUN echo "My python website" | tee index.html
CMD python3 -m http.server
EXPOSE 8000