Skip to content

Instantly share code, notes, and snippets.

@creack
Last active December 14, 2015 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creack/5145303 to your computer and use it in GitHub Desktop.
Save creack/5145303 to your computer and use it in GitHub Desktop.
#!/bin/sh
rm -rf rootfs
mkdir rootfs
cd rootfs
mkdir -p bin etc dev dev/pts lib proc sys tmp usr var/run
touch etc/resolv.conf
cat /etc/passwd | head -1 > etc/passwd
cat /etc/group | head -1 > etc/group
ln -s lib lib64
ln -s bin sbin
ln -s ../bin usr/bin
cp /bin/busybox bin
for X in $(busybox --list)
do
ln -s busybox bin/$X
done
rm bin/init
ln bin/busybox bin/init
#cp /usr/bin/users bin
#cp /var/run/utmp var/run/
cp /lib/x86_64-linux-gnu/libpthread.so.0 lib
cp /lib/x86_64-linux-gnu/libc.so.6 lib
cp /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 lib
cp /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 lib
cp /lib/x86_64-linux-gnu/libdl.so.2 lib
for X in console null ptmx random stdin stdout stderr tty urandom zero
do
cp -a /dev/$X dev
done
tar -C . -c . -f /var/lib/docker/docker-ut.tar
go test -v .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment