Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker tutorial 'Getting Started' doesn't work

Tags:

docker

I have Ubuntu 20.04, Mozilla Firefox 87.0, Google Chrome 89.0.4389.90.

I am trying to run the Docker Getting-started tutorial. I read a couple of posts from stack overflow to not avail. Also I checked this ToDo App (localhost:3000) shows no UI in Browser #9 and this enter link description here again to not avail. I do,

sudo docker build -t getting-started . sudo docker run -dp 3000:3000 getting-started

and then when I go to http://localhost:3000 I get,

In Firefox, enter image description here

in Chrome the following images alternate, enter image description here enter image description here

When I run, sudo docker ps -a I get, enter image description here

Finally, do you suggest any Docker tutorial for beginners? I want to have enough understanding for Docker so that I can write scripts to manage docker images.

like image 297
vpap Avatar asked Mar 13 '26 08:03

vpap


2 Answers

You might be building and running the Dockerfile outside the "app" directory which has this behaviour. As the tutorial says, first go to the app directory, create a Dockerfile there and then build and run. This should work.

3000:80 opens the tutorial because the default Dockerfile builds the docker/getting-started which is the tutorial.

like image 86
friedgenius Avatar answered Mar 16 '26 05:03

friedgenius


Might be the problem something is blocking the port on your machine so try to Replace the port to 80 instead of 3000. Change from

docker run -dp 3000:3000 getting-started

to

docker run -dp 3000:80 getting-started

and then open browser and hit http://localhost:3000

like image 32
Ashok Avatar answered Mar 16 '26 04:03

Ashok



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!