diff --git a/Dockerfile-unison2.48.4-ocaml4.03 b/Dockerfile-unison2.48.4-ocaml4.03 new file mode 100644 index 0000000..08bf48c --- /dev/null +++ b/Dockerfile-unison2.48.4-ocaml4.03 @@ -0,0 +1,31 @@ +FROM phusion/baseimage:0.9.16 +CMD ["/sbin/my_init"] + +MAINTAINER Leigh McCulloch + +# Upload Unison for building +COPY container / + +# Allow setting these on build +ARG UNISON_VERSION=2.48.4 +ARG OCAML_VERSION=4.03 + +# Build and install Unison versions then cleanup +RUN apt-get update -y \ + && curl -LO http://download.opensuse.org/repositories/home:ocaml/xUbuntu_14.04/Release.key \ + && apt-key add - < Release.key \ + && apt-get update -y \ + && dependencies-install.sh \ + && unison-install.sh \ + && dependencies-purge.sh \ + && rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/* + +# Set default Unison configuration +ENV UNISON_WORKING_DIR=/unison + +# Set working directory to be the home directory +WORKDIR /root + +# Setup unison to run as a service +VOLUME $UNISON_WORKING_DIR +EXPOSE 5000 diff --git a/Makefile b/Makefile index 4a24509..25e3664 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ build: + sed -e "s/\$${UNISON_VERSION}/2.48.4/" -e "s/\$${OCAML_VERSION}/4.03/" Dockerfile > Dockerfile-unison2.48.4-ocaml4.03 sed -e "s/\$${UNISON_VERSION}/2.48.3/" -e "s/\$${OCAML_VERSION}/4.02/" Dockerfile > Dockerfile-unison2.48.3-ocaml4.02 sed -e "s/\$${UNISON_VERSION}/2.48.3/" -e "s/\$${OCAML_VERSION}/4.01/" Dockerfile > Dockerfile-unison2.48.3-ocaml4.01 sed -e "s/\$${UNISON_VERSION}/2.40.102/" -e "s/\$${OCAML_VERSION}/4.02/" Dockerfile > Dockerfile-unison2.40.102-ocaml4.02 diff --git a/README.md b/README.md index daf666a..bfb80bf 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,9 @@ $ fswatch -o . | xargs -n1 -I{} unison . socket://:5000/ -ignore 'Path . Unison requires the version of the client (running on the host) and server (running in the container) to match. * 2.40.102 (available via `apt-get install unison` on Ubuntu 14.04, 14.10, 15.04) [compiled with ocaml 4.01] - * 2.48.3 (available via `brew install unison` on Mac OS X) [compiled with ocaml 4.02] + * 2.48.4 (available via `brew install unison` on Mac OS X) [compiled with ocaml 4.03] + +If you are installing unison by source, you can Check what version of ocaml that will be used during compilation by running `ocaml --version`. ## Available Unison Images This docker repository includes common versions of Unison server compiled with different versions of OCaml. The version you need can be selected by choosing the appropriately tagged image from the docker hub repository. Images are tagged in the format: @@ -74,19 +76,22 @@ VERSION-[unisonUNISON_VERSION[-OCAML_VERSION]] Supported versions are any combination of the following: - * Unison 2.40.102 and 2.48.3 - * OCaml 4.01 and 4.02 + * Unison 2.40.102, 2.48.3, 2.48.4 + * OCaml 4.01, 4.02, 4.03 Additional versions can be added easily on request. Open an Issue if you need another version. ### Examples | Docker Image Tag | Unison | OCaml | | ------------------------------------------------------- | ---------- | ------- | -| `leighmcculloch/unison:latest` | `2.48.3` | `4.02` | -| `leighmcculloch/unison:latest-unison2.48.3` | `2.48.3` | `4.02` | +| `leighmcculloch/unison:latest` | `2.48.4` | `4.03` | +| `leighmcculloch/unison:latest-unison2.48.4-ocaml4.03` | `2.48.4` | `4.03` | +| `leighmcculloch/unison:latest-unison2.48.4-ocaml4.02` | `2.48.4` | `4.02` | +| `leighmcculloch/unison:latest-unison2.48.4-ocaml4.01` | `2.48.4` | `4.01` | +| `leighmcculloch/unison:latest-unison2.48.3-ocaml4.03` | `2.48.3` | `4.03` | | `leighmcculloch/unison:latest-unison2.48.3-ocaml4.02` | `2.48.3` | `4.02` | | `leighmcculloch/unison:latest-unison2.48.3-ocaml4.01` | `2.48.3` | `4.01` | -| `leighmcculloch/unison:latest-unison2.40.102` | `2.40.102` | `4.02` | +| `leighmcculloch/unison:latest-unison2.40.102-ocaml4.03` | `2.40.102` | `4.03` | | `leighmcculloch/unison:latest-unison2.40.102-ocaml4.02` | `2.40.102` | `4.02` | | `leighmcculloch/unison:latest-unison2.40.102-ocaml4.01` | `2.40.102` | `4.01` | diff --git a/container/tmp/unison/unison-2.48.4.tar.gz b/container/tmp/unison/unison-2.48.4.tar.gz new file mode 100644 index 0000000..4ec3b55 Binary files /dev/null and b/container/tmp/unison/unison-2.48.4.tar.gz differ diff --git a/container/usr/local/bin/dependencies-install.sh b/container/usr/local/bin/dependencies-install.sh index 6c23935..66aa34e 100755 --- a/container/usr/local/bin/dependencies-install.sh +++ b/container/usr/local/bin/dependencies-install.sh @@ -1,19 +1,12 @@ #!/bin/sh -case "${OCAML_VERSION}" in - '4.02' | 'latest') - apt-get install -y ocaml - ;; - *) - apt-get install -y\ - ocaml=${OCAML_VERSION}.*\ - camlp4=${OCAML_VERSION}.*\ - ocaml-nox=${OCAML_VERSION}.*\ - ocaml-base=${OCAML_VERSION}.*\ - ocaml-interp=${OCAML_VERSION}.*\ - ocaml-base-nox=${OCAML_VERSION}.*\ - ocaml-compiler-libs=${OCAML_VERSION}.*\ - ;; -esac +apt-get install -y\ +ocaml=${OCAML_VERSION}.*\ +camlp4=${OCAML_VERSION}.*\ +ocaml-nox=${OCAML_VERSION}.*\ +ocaml-base=${OCAML_VERSION}.*\ +ocaml-interp=${OCAML_VERSION}.*\ +ocaml-base-nox=${OCAML_VERSION}.*\ +ocaml-compiler-libs=${OCAML_VERSION}.* apt-get install -y build-essential exuberant-ctags