Skip to content

Instantly share code, notes, and snippets.

@0xquad
Last active November 23, 2015 17:20
Show Gist options
  • Save 0xquad/8aa3812ea7788d2bc687 to your computer and use it in GitHub Desktop.
Save 0xquad/8aa3812ea7788d2bc687 to your computer and use it in GitHub Desktop.
Script to create a stripped down version of the Docker Debian image
#!/bin/sh
#
# Copyright (c) 2015, Alexandre Hamelin <alexandre.hamelin gmail.com>
# Released under the MIT LICENSE.
# Create a stripped down debian image.
docker pull debian
cid=$(docker run -dt debian)
docker exec $cid rm -fr /usr/share/doc /usr/share/man /usr/share/locale
docker stop $cid >/dev/null
docker export $cid | docker import -c 'CMD ["/bin/bash"]' - debian-small >/dev/null
docker rm $cid >/dev/null
docker images | grep debian-small
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment