Skip to content

Instantly share code, notes, and snippets.

@steezeburger
Last active April 25, 2018 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steezeburger/d6f34097d42daa5669d22077738cbc01 to your computer and use it in GitHub Desktop.
Save steezeburger/d6f34097d42daa5669d22077738cbc01 to your computer and use it in GitHub Desktop.

Docker Lunch n Learn - Matthew Johnson 4/25/2018

Notes

  • docker build -t name .

    • builds container from image with name
    • looks at Dockerfile
  • docker run, docker run -it -p 3200:80 -e ENV=QA legacy

    • looks at Dockerfile
    • -it interactive terminal, -p port, -e env variables
    • starts container created from docker build
  • docker-compose up

    • docker-compose.yml
    • way to define and manage multiple containers that may depend on each other
  • layer caching in Dockerfile

    • put things that change most often at the bottom
  • networking

    • -p 3200:80 host_port:docker_local_port
  • env variables

    • env variables should come from docker-compose.yml for local dev
    • in prod, they should come from the environment
  • docker ps -a - list all containers

  • docker ps - list all running containers

  • get container id from ps command

    • docker inspect :id - lots of info about container
    • docker logs :id - logs

Questions

  • when to build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment