Skip to content

Instantly share code, notes, and snippets.

@TheBigBear
Forked from nsfmc/Dockerfile.tmpl
Last active August 29, 2015 13:59
Show Gist options
  • Save TheBigBear/10661436 to your computer and use it in GitHub Desktop.
Save TheBigBear/10661436 to your computer and use it in GitHub Desktop.
Seeking to get a boot2docker iso file for my Mac to allow me to boot a modified tinycore linux image that has the virtual box fs drivers for using shared folders already included
#!/usr/bin/env sh
get_vbox_version(){
local VER
VER=$(VBoxManage -v | awk -F "r" '{print $1}')
if [ -z "$VER" ]; then
echo "ERROR"
else
echo "$VER"
fi
}
write_vbox_dockerfile(){
local VER
VER=$(get_vbox_version)
if [ ! "$LATEST_RELEASE" = "ERROR" ]; then
sed "s/\$VBOX_VERSION/$VER/g" Dockerfile_vboxfs.tmpl > Dockerfile
else
echo "WUH WOH"
fi
}
write_vbox_dockerfile
# $VBOX_VERSION should probably be something like 4.3.10 or somesuch
#
FROM boot2docker/boot2docker-rootfs
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
sh VBoxLinuxAdditions.run --noexec --target . && \
mkdir x86 && cd x86 && tar xvjf ../VBoxGuestAdditions-x86.tar.bz2 && cd .. && \
mkdir amd64 && cd amd64 && tar xvjf ../VBoxGuestAdditions-amd64.tar.bz2 && cd .. && \
cd amd64/src/vboxguest-$VBOX_VERSION && KERN_DIR=/linux-kernel/ make && cd ../../.. && \
cp amd64/src/vboxguest-$VBOX_VERSION/*.ko $ROOTFS/lib/modules/$KERNEL_VERSION-tinycore64 && \
mkdir -p $ROOTFS/sbin && cp x86/lib/VBoxGuestAdditions/mount.vboxsf $ROOTFS/sbin/
RUN depmod -a -b $ROOTFS $KERNEL_VERSION-tinycore64
@TheBigBear
Copy link
Author

I am on a journey to try to get my boot2docker vbox image on my mac to boot a modified tinycore linux image that has the virtual box drivers for using shared folders, not sure if I will get there.
So, it's going to be a combination of the following three github docker projects
https://github.com/boot2docker/boot2docker
with the vbox fs drivers on top from
https://gist.github.com/nsfmc/9862241
and a Mac OS X installer
https://github.com/noplay/docker-osx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment