Giter Site home page Giter Site logo

node-docker's Introduction

To run the image, run the following on terminal

1. build the image first by runnning (from the root directory)

~ docker build .

2. Then expose the image to your local machine  (first port is your local machine, then the next one is the docker image, --rm removes once completed)

docker run -p 3000:80 xxxx --rm (image name)

3. Browse your computer / browser to 

localhost:3000 


4. To stop the image from runnning

Run 

docker ps -a

5. to find the running image copy the name, then run 

docker stop xxxx (image name)

6. image is successfully stopped.

NB:

if code is changed you have to build the image whole again

7. List images
docker images

8. Remove image
docker rmi xxxx (image name)

9. Remove all images
docker rmi $(docker images -a -q)

10. Remove all containers
docker rm $(docker ps -a -q)

11. Remove all images and containers
docker system prune -a

12. Remove all stopped containers
docker rm $(docker ps -a -q)

13. Tag a docker image

docker tag xxxx (image name) xxxx (image name)

14. analyze docker image

docker xxxx inspect  (image name)

15. Run docker image in background

docker run -d -p 3000:80 --rm xxxx (image name)

16. Start an existing docker image

docker start xxxx (image name)

17. to see the logs of a running docker image

docker logs xxxx (image name)

18. to see the logs of a running docker image in real time

docker logs -f xxxx (image name)

19. starting docker in attach mode

docker start -a xxxx (image name)

20. docker start in interactive mode

docker run -it xxxx (image name) / docker start -a -i xxxx (image name)

21. remove all stopped containers

docker rm $(docker ps -a -q)

22. remove all images

docker rmi $(docker images -a -q)

23. copy files from local to docker image

docker cp xxxx (image name):/path/to/file /path/to/file

24. copy files from docker image to local

docker cp /path/to/file xxxx (image name):/path/to/file

node-docker's People

Contributors

felixivance avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.