Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. // fetch image
  2. docker pull <image>
  3.  
  4. // run image and open terminal in image
  5. // -d flag runs the container in detached mode, i.e., the terminal exist but the container is still running
  6. docker run alpine -it /bin/sh
  7.  
  8. /*
  9. --name : container name
  10. -e : env variables
  11. -d : detached mode
  12. -P : publish all container ports to ramdon ports in the host
  13. */
  14. docker run --name static-site -e AUTHOR="Rafa" -d -P seqvence/static-site
  15.  
  16. /*
  17. -p : maps host port to container port
  18. */
  19. docker run --name static-site -e AUTHOR="Rafa" -d -p 8888:80 seqvence/static-site
  20.  
  21. /*
  22. list all ports of image
  23. */
  24. docker port <image>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement