Docker Community Forums

Share and learn in the Docker community.

Serve an HTML file using 'Play with Docker'

Is it possible to view in my own browser an HTML generated output file produced by running code on a Docker Ubuntu instance that was set up in ‘Play with Docker’ ?

here is the link for ‘Play with Docker’:

Sorry if this is a stupid or noob or strange question, But I am just starting out with Docker, And I cannot find an easy way to view my HTML produced file that is residing inside my Docker Ubuntu instance…

Thanks for any help.

try this
apt update
apt install nginx

and if apt cannot be found try
yum update
yum install nginx

Then move your html file to /var/www/html/

1 Like

Thank you for your answer, I have now accomplished doing that.

But now I have another problem, I do not know what URL should I put into my browser’s URL area so that it will navigate to my HTML file…

Thanks for any more help

It will be the IP of your docker container, I’m not sure how you have set it up so try this:

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

You can get your container ID with docker ps or docker ps --all