Sign inSign up

actionanand/node-app

By actionanand

Updated almost 3 years ago

It's a basic node app (express app)

Image
0

46

actionanand/node-app repository overview

Basic Node App using docker

How to Build this image

docker build . -t actionanand/node-app:tagname

How to Pull this image from docker hub

docker pull actionanand/node-app

or

docker pull actionanand/node-app:tagname

How to run this image

docker run -d -p 3000:80 --rm --name node-app actionanand/node-app:tagname

How to rename(clone) the image

docker tag local-image:tagname new-repo:tagname

Pushing local image to docker hub

docker push actionanand/node-app:tagname

Where to view the app

http://localhost:3000/

Output

image

Other useful commands

  • docker ps: List all running containers
    • -a : List all containers - including stopped ones
  • docker images : List all locally stored images
  • docker stop my_container : Stops the running container with the name 'my_container' or ID
  • docker rm CONTAINER : Remove a container with name CONTAINER (you can also use the container id). You can use multiple container name or ID followed by white space. SO docker rm CONTAINER_1 CONTAINER_2 CONTAINER_3
  • docker rmi IMAGE : Remove an image by name / id. You can use multiple image name or ID followed by white space.
  • docker container prune : Remove all stopped containers
  • docker image prune : Remove all dangling images (untagged images)
    • -a : Remove all locally stored images
  • docker attach container_name: Will attach the container again
  • docker logs container_name: Will print logs by the container
    • -f : follow tag will attach it again to print the future logs in terminal

Tag summary

Content type

Image

Digest

sha256:0b4e242e3

Size

382.6 MB

Last updated

almost 3 years ago

docker pull actionanand/node-app:1