I am working with docker docker on windows 10 pro. I created ubuntu container with apache, mysql,phpmyadmin. How can I run this as localhost on my pc.
Container IP – 172.17.0.5
I am working with docker docker on windows 10 pro. I created ubuntu container with apache, mysql,phpmyadmin. How can I run this as localhost on my pc.
Container IP – 172.17.0.5
2
Answers
The answer for this could vary depending on whether you have installed docker for windows or docker toolbox. If it is the first case you can simply start the container and access them through localhost with the published port. You can run the following command to run the container and bind the ports to the host machine.
After that access the relevant ports as
localhost:host_port
If you are using docker toolbox you need to find the docker machine ip that is being used.
This can be obtained by
docker-machine ip
and access the application you want usingip:port
if you want to deploy a static page use
docker run -d -p 80:80 image_name /usr/sbin/apache2ctl -D FOREGROUND
provided your index.php or HTML files are inside /var/www/html
BUT IF YOU HAVE DATABASE TOO THEN YOU WILL ONLY GET THE WEB UI