Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 401 Bytes

Docker.md

File metadata and controls

19 lines (13 loc) · 401 Bytes

Docker cheat sheet

  • log into a container
docker exec -it <container-name> /bin/bash
  • get ip of container
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container-name>
  • run a container with environment variables
docker run --name <name-of-container> --env <environment-variable>=<value-for-variable> -d <docker-image-name>