Skip to content

Instantly share code, notes, and snippets.

@buddhamagnet
Last active October 25, 2018 15:13
Show Gist options
  • Save buddhamagnet/531af3507aaeec1c6458cdcbd87304e2 to your computer and use it in GitHub Desktop.
Save buddhamagnet/531af3507aaeec1c6458cdcbd87304e2 to your computer and use it in GitHub Desktop.
docker-inception

1. SETUP

FORK THE MOBY REPO

  • https://github.com/moby/moby

MAKE SURE YOUR USERNAME AND PASSWORD ARE CONFIGURED IN GIT

  • git config --local user.name "FirstName LastName"
  • git config --local user.email "email"

CREATE A FEATURE BRANCH

  • Create branch
  • Make a change
  • Commit using -s for signed commits

REMOVE ALL CRUFT

  • docker system prune -a
  • docker rmi -f $(docker images -q -a -f dangling=true)

2. INCEPTION

START A DEVELOPMENT CONTAINER

  • make BIND_DIR=. shell
  • You will now be at the shell prompt
  • Confirm you see your new change in the container

MAKE A DOCKERD BINARY

  • hack/make.sh binary
  • make install
  • dockerd -D &
  • The above commands can be run via hack/make.sh binary install-binary run

CHECK DOCKER VERSIONS

  • docker version

RUN THE HELLO WORLD IMAGE

  • docker run hello-world

LIST ALL IMAGES

  • docker images

IN A NEW TERMINAL, VIEW YOUR DEVELOPMENT CONTAINER

  • docker ps

3. MAKING CODE CHANGES

  • Make a change in your branch.
  • In your container, stop Docker if running.
  • Rebuild the binary with hack/make.sh binary install-binary
  • Your changes will now be bundled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment