Skip to content

Commit

Permalink
add how to build and run the ISO
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenDowideit committed Jul 17, 2015
1 parent 6800ce0 commit ca66de9
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,21 @@ test:

nfs:
docker run --rm -it --volume-driver=nfs -v 127.0.0.1/data:/no busybox ls -la

iso: build
cp app experimental/docker-volume-nfs
docker build -t boot2docker:experimental experimental/
docker run --name boot2docker-run boot2docker:experimental > experimental/boot2docker.iso
docker cp boot2docker-run:/linux-kernel/arch/x86_64/boot/bzImage experimental/
docker cp boot2docker-run:/tmp/iso/boot/vmlinuz64 experimental/
docker cp boot2docker-run:/tmp/iso/boot/initrd.img experimental/
docker rm boot2docker-run

run:
qemu-system-x86_64 -serial stdio \
-curses \
-net nic,vlan=0 -net user,vlan=0 \
-m 2048M \
-kernel experimental/vmlinuz64 -initrd experimental/initrd.img \
-append "root=/dev/ram0 rw sven=test panic=0 append loglevel=7 user=docker console=ttyAMA0 console=ttyS0 console=tty0 apparmor=0 selinux=1 noembed nomodeset norestore base"

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ To use the plugin when mounting an NFS export `nfs://127.0.0.1:/data`, run:

> Note: because of the way docker parses colons, you need to omit them from the NFS share.
## Build and run in Boot2Docker qemu VM

`make iso` will build an experimental boot2docker ISO which will auto-start the nfs volume-plugin.

If you're on Linux, you can run it in Qemu-kvm using `make run`.

## License

MIT
22 changes: 22 additions & 0 deletions experimental/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM boot2docker

ENV LOCALBIN $ROOTFS/usr/local/bin/

# TODO is there an ADD attr that chmod's?
RUN curl -L -o $LOCALBIN/docker https://experimental.docker.com/builds/Linux/x86_64/docker-latest \
&& chmod 755 $LOCALBIN/docker

# add the magic nfs volume driver
ADD ./docker-volume-nfs $LOCALBIN/docker-volume-nfs
# Create the plugins socket dir
RUN mkdir -p $ROOTFS/usr/share/docker/plugins
# TODO: should test to see if there is one, and merge
ADD ./bootsync.sh $ROOTFS/var/lib/boot2docker/bootsync.sh

#ADD https://github.com/docker/machine/releases/download/v0.1.0-rc1/docker-machine_linux_amd64 $LOCALBIN/machine
#ADD https://github.com/docker/swarm/releases/download/v0.1.0-rc1/docker-swarm-Linux-x86_64 $LOCALBIN/swarm
#ADD https://github.com/docker/fig/releases/download/1.1.0-rc1/docker-compose-Linux-x86_64 $LOCALBIN/docker-compose

RUN /make_iso.sh

CMD ["cat", "boot2docker.iso"]
4 changes: 4 additions & 0 deletions experimental/bootsync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

echo "start NFS Docker volume plugin"
/usr/local/bin/docker-volume-nfs > /var/log/docker-volume-nfs.log 2>&1 &

0 comments on commit ca66de9

Please sign in to comment.