Docker Notes

Run a new docker in foreground

Docker will immediately exit if it does not have something to run and keep it running

Example

docker run ubuntu:oracular

Will immediately exit. This will keep running until I exit the shell

docker run -it ubuntu:oracular sh

Test Docker to keep running detached

  • d, --detach=false Run container in background and print container ID
  • -t, --tty=false Allocate a pseudo-TTY
docker run -td ubuntu:oracular

Assign a Static IP to Docker Instance

First create a network in docker