Skip to content

Instantly share code, notes, and snippets.

@pavelz
Forked from johannespetzold/Dockerfile
Last active August 29, 2015 14:07
Show Gist options
  • Save pavelz/757e557c2125a5e516b4 to your computer and use it in GitHub Desktop.
Save pavelz/757e557c2125a5e516b4 to your computer and use it in GitHub Desktop.
boot2docker stop
VBoxManage sharedfolder add boot2docker-vm -name workspace -hostpath $HOME/workspace
boot2docker up
boot2docker ssh "sudo modprobe vboxsf && sudo mkdir -p $HOME/workspace && sudo mount -t vboxsf -o umask=0022,gid=50,uid=1000 workspace $HOME/workspace"
#!/bin/bash -ex
export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375
docker build -t my-boot2docker-img .
docker run --rm my-boot2docker-img > boot2docker.iso
FROM boot2docker/boot2docker
RUN apt-get -y install p7zip-full
ENV VBOX_VERSION 4.3.12
# Build VBox guest additions
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
RUN /make_iso.sh
CMD ["cat", "boot2docker.iso"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment