Skip to content

balab2020/hello-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisites:

Build docker image

docker build -t balab2020/node-web-app .

balab2020/node-web-app is docker image name

Run Docker Image

docker run -p 49160:8080 -d balab2020/node-web-app

-d runs the container in detached mode -p flag redirects a public port to a private port inside the container

49160 is the system ip mapped with docker instance 8080 ip

List running images

docker ps

Sample Output:

CONTAINER ID IMAGE NAMES COMMAND CREATED STATUS PORTS
c249cfa8fd79 balab2020/node-web-app "npm start" 35 seconds ago Up 18 seconds 0.0.0.0:49160->8080/

Connect to docker instance

docker exec -it CONTAINER_ID bash

Display logs of container

docker logs CONTAINER_ID

Check running instance service

curl -i localhost:49160

About

Learning Docker : Hello Docker From node module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published