Home > Net >  Serving a webpage using docker container on rocky linux running on an oracle virtual machine
Serving a webpage using docker container on rocky linux running on an oracle virtual machine

Time:03-20

I've managed to install and run Rocky Linux on an Oracle VM. Now I want to serve a Nodejs app in a Docker container. The app is running on port 3000, I can see it's running when I run the systemctl status Docker command. However, when I go to mylinuxipaddress:3000 it says the server is taking too long to respond. it just spins forever and stops, basically no response. Can anyone please show me what I'm doing wrong?

CodePudding user response:

Check if curl is working fine from vm console itself. And i hope you are using bridge adapter or vmhost network type (not nat).

CodePudding user response:

Map the host port with the container port using -P flag

e.g. sudo docker run -p3000:3000 <image_name>:latest

Also systemctl command shows the processes running on the host system. To see all the docker containers running use sudo docker ps -a

  • Related