Allows me to mount /Users into boot2docker which is incredibly useful for
my local Docker environment under Mac OSX. So from Mac I can do sth like this:
docker run -v /Users/mattes/somedir:/data/somedir [..]
.
This Dockerfile will download the latest boot2docker image (see FROM boot2docker/boot2docker
)
and adds VirtualBox Guest Additions for your running VirtualBox version.
See also boot2docker/boot2docker#284.
I tried to make the mount permanent from within the VirtualBox GUI (see screenshot)
but that didn't work. So I added the mount logic to $ROOTFS/etc/rc.d/vbox-guest-additions-permanent-mount
(see Dockerfile.tmpl)
See build log here https://gist.github.com/mattes/6bed15318e93925b1280
# generate Dockerfile from Dockerfile.tmpl
chmod +x build_docker.sh
./build_docker.sh
# build the actual boot2docker.iso with virtual box guest additions
docker build -t mattes/boot2docker-vbga .
# the following line is proposed in many tutorials, but does not work for me
# (it outputs an iso that won't work)
docker run -i -t --rm mattes/boot2docker-vbga > boot2docker.iso
# so I do:
docker run -i -t --rm mattes/boot2docker-vbga /bin/bash
# then in a second shell:
docker cp <Container-ID>:boot2docker.iso boot2docker.iso
# use the new boot2docker.iso
boot2docker stop
mv ~/.boot2docker/boot2docker.iso ~/.boot2docker/boot2docker.iso.backup
mv boot2docker.iso ~/.boot2docker/boot2docker.iso
VBoxManage sharedfolder add boot2docker-vm -name home -hostpath /Users
boot2docker up
boot2docker ssh "ls /Users" # to verify if it worked