Skip to content

Instantly share code, notes, and snippets.

@nsfmc
Created March 29, 2014 20:23
Show Gist options
  • Save nsfmc/9862241 to your computer and use it in GitHub Desktop.
Save nsfmc/9862241 to your computer and use it in GitHub Desktop.
a dockerfile which i
#!/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.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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment