Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
Last active August 29, 2015 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pcolazurdo/e61cfb84812a70b93e74 to your computer and use it in GitHub Desktop.
Save pcolazurdo/e61cfb84812a70b93e74 to your computer and use it in GitHub Desktop.
Installing Mesos on Docker for Windows
# Installing Mesos on Docker for Windows
Trying to make Mesos run on a Docker instance on Windows (boot2docker) I've found quite a few issues that I think it can be useful to know about
## Issue #1: Default docker container max size is not enough
Growing a container beyond the 10GB limit is not pretty well documented (at least as this writing) So I've had to make a few steps:
> <b>BE VERY CAREFUL: This process will delete all your existing images/containers. I haven't tryed yet modifying this with existing containers </b>
Starting from the Windows Console you can run:
```
c:\> boot2docker start
c:\> boot2docker ssh
$ sudo su
```
Edit `/usr/lib/boot2docker/profile` and add:
```
#!/bin/sh
export EXTRA_ARGS="--storage-opt dm.basesize=20G"
```
Then you should run:
```
$ /etc/init.d/docker stop
$ rm -rf /var/lib/docker
$ /etc/init.d/docker start
```
Then look in `/var/log/docker.log` to see if the new parameters have been applied. You'd find something like this:
```
$ /usr/local/bin/docker -d -D -g "/var/lib/docker" -H unix:// -H tcp://0.0.0.0:2376 <b> --storage-opt dm.basesize=20G </b> --tlsverify --tlscacert=/var/lib/boot2docker/tls/ca.pem --tlscert=/var/lib/boot2docker/tls/server.pem --tlskey=/var/lib/boot2docker/tls/serverkey.pem >> "/var/lib/boot2docker/docker.log"
```
### Issue 1.1: DeviceMapper is not the default storage driver for boot2docker
If this is the case the previous modification won't work so you'll have fix this also.
Check if the storage driver for docker is `devicemapper` by running:
```
$ docker info | grep "Storage Driver"
```
If this is not `devicemapper` you will have to change it by modifying the previous `EXTRA_ARGS` to the following
```
export EXTRA_ARGS= "--storage-opt dm.basesize=20G --storage-driver=devicemapper"
```
For this changes to take effect you'll have to delete `/var/lib/docker` again and restart the docker daemon.
*Note:* You may have issue deleting the `/var/lib/docker` if aufs has been already initiated. You'll receive the following errors if this is the case:
```
rm: can't remove '/var/lib/docker/aufs': Device or resource busy`
rm: can't remove '/var/lib/docker': Directory not empty`
```
To fix this you can use:
```
$ umount -l $(grep 'aufs' /proc/mounts | awk '{print $2}' | sort -r)
$ rm -rf /var/lib/docker
```
touch /var/lib/boot2docker
echo #!/bin/sh >> /var/lib/boot2docker
echo export EXTRA_ARGS="--storage-opt dm.basesize=20G --storage-driver=devicemapper" >> /var/lib/boot2docker
umount -l $(grep 'aufs' /proc/mounts | awk '{print $2}' | sort -r)
rm -rf /var/lib/docker/
FROM ubuntu
MAINTAINER @pcolazurdo
RUN apt-get update && apt-get -y install wget build-essential openjdk-6-jdk python-dev python-boto libcurl4-nss-dev libsasl2-dev maven libapr1-dev libsvn-dev
RUN cd tmp && wget http://www.apache.org/dist/mesos/0.20.1/mesos-0.20.1.tar.gz && tar -zxf mesos-0.20.1.tar.gz
cd mesos-0.20.1 && mkdir build && cd build && ../configure && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment