Skip to content
This repository has been archived by the owner on Dec 8, 2019. It is now read-only.

Add a Dockerfile for Unison 2.48.4 and Ocaml 4.03 #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Dockerfile-unison2.48.4-ocaml4.03
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ $ fswatch -o . | xargs -n1 -I{} unison . socket://<docker>: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:
Expand All @@ -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` |

Expand Down
Binary file added container/tmp/unison/unison-2.48.4.tar.gz
Binary file not shown.
23 changes: 8 additions & 15 deletions container/usr/local/bin/dependencies-install.sh
Original file line number Diff line number Diff line change
@@ -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