Getting started with docker on Windows host machine? Great this is a quick Docker intro tutorial on how to pull, build, run and access docker containers on exposed port in the browser. We will also highlight some common problems when trying to run docker container on exposed port why it does not work and what to do to fix this.
docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
cd getting-started docker build -t docker101tutorial .
docker run -d -p 80:80 --name docker-tutorial docker101tutorial
The above project should start on localhost on port 80 on
http (and not
https!). So the url would be
http://localhost:80 but this is not always the case. Sometimes this pot will not work due to be used by other program or defined in Windows host file for something else. In that case you can try to move the docker definition to the top of the host declaration or access it through VM IP address like in the example below:
Access docker container on port 80 of your docker VM IP address
http://192.168.1.101:80 (this IP will change)Access container in the browser
To find out your current IP see this article What is the IP of docker virtual host on Windows?
#docker push <username>/<imagename> docker push devwl/docker101tutorial
See what you have saved on docker hub here