grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

what_happens_when_we_run_a_container.md (571B)


      1 # debrief: what happens when we run a container
      2 
      3 - looks for image locally
      4 - if not locally pulls to from repo (default docker hub)
      5 - downloads latest version by default
      6 - creates new container
      7 - gives a virt ip on private network inside docker engine
      8 - opens up port 80 on host and forwards to port 80 in container
      9 - starts container using the CMD in the image dockerfile
     10 
     11 ```
     12 docker container run --publish 8080:80 --name webhost -d nginx:1.11 nginx -T
     13 ```
     14 - change host listening port to `8080`
     15 - change version of image to `1.11`
     16 - change CMD run on start with `-T`
     17