Skip to content

Instantly share code, notes, and snippets.

@lpenz
Last active March 1, 2018 06:49
Show Gist options
  • Save lpenz/8d2555bca4fc20ba0118 to your computer and use it in GitHub Desktop.
Save lpenz/8d2555bca4fc20ba0118 to your computer and use it in GitHub Desktop.
debootstrap a bare debian docker image
#!/bin/bash
DIST=${1?no distribution specified}
ARCH=${2:amd64}
set -e -x
NAME=debian-${DIST}-${ARCH}
debootstrap --no-check-gpg "--arch=$ARCH" "$DIST" "$NAME" http://archive.debian.org/debian
tar -C "$NAME" -c . | docker import - "$USER/$NAME"
: "$USER/$NAME" built
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment