Skip to content

Instantly share code, notes, and snippets.

@jpetazzo jpetazzo/ Secret
Last active Nov 11, 2017

What would you like to do?
Fixup buildroot for docker
[ -f rootfs.tar ] || {
echo "Hmm this should run in the directory of rootfs.tar"
exit 1
rm -rf extra
mkdir extra extra/etc extra/sbin extra/lib extra/lib64
touch extra/etc/resolv.conf
touch extra/sbin/init
# Uncomment this if you want to include docker in the image, for testing purposes
#cp $(which docker) extra
# You might have to run "ldd $(which docker)" and adjust those paths
cp /lib/x86_64-linux-gnu/ /lib/x86_64-linux-gnu/ extra/lib
cp /lib64/ extra/lib64
cp rootfs.tar fixup.tar
tar rvf fixup.tar -C extra .
docker import - dietfs < fixup.tar
docker run -t -i dietfs /bin/sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.