diff options
author | Linus Nordberg <linus@nordberg.se> | 2015-04-13 14:19:38 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2015-04-13 17:11:07 +0200 |
commit | cf6e64bf94677092ef94a6f4ed7c1391dcd43f23 (patch) | |
tree | 903d5a399ce3c4a98fe0a61e51a024c9f4616dda /packaging/docker/catlfish-dev/Dockerfile | |
parent | 2e7ae73196da22dcf9b4817fc38861774ff61b84 (diff) |
Run all types of nodes from the same docker image.
Diffstat (limited to 'packaging/docker/catlfish-dev/Dockerfile')
-rw-r--r-- | packaging/docker/catlfish-dev/Dockerfile | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/packaging/docker/catlfish-dev/Dockerfile b/packaging/docker/catlfish-dev/Dockerfile index 11ebed5..241c58d 100644 --- a/packaging/docker/catlfish-dev/Dockerfile +++ b/packaging/docker/catlfish-dev/Dockerfile @@ -2,18 +2,29 @@ # /usr/local/etc/catlfish/catlfish.config so mounting # /usr/local/etc/catlfish is recommended. This can be done using the # `-v' flag to `docker run'. - +# # NOTE: The directory on the host system that's mounted at # /var/local/db/catlfish in the container has to be writable by a host # user with uid 147. - +# +# Example, running a frontend node: +# $ docker run -v /etc/catlfish:/usr/local/etc/catlfish:ro catlfish +# frontend /usr/local/catlfish +# +# Example, running a merge node: # $ docker run -v /etc/catlfish:/usr/local/etc/catlfish:ro catlfish +# merge /usr/local/catlfish /var/local/db/catlfish-merge FROM erlang RUN apt-get update RUN echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections + +# For building. RUN apt-get -y -q install gcc git make curl +# For merge. +RUN apt-get -y -q install git python-ecdsa python-yaml + # Build dependencies in /usr/local/src. WORKDIR /usr/local/src @@ -41,10 +52,8 @@ RUN make -C plop RUN git clone https://git.nordu.net/catlfish.git RUN make -C catlfish PREFIX=/usr/local all release -# Config dir and database dir are mounted from host using `-v' to -# 'docker run'. +# Config dir is mounted from host using `-v' to 'docker run'. VOLUME /usr/local/etc/catlfish -VOLUME /var/local/db/catlfish # Create a catlfish user. RUN groupadd --gid 147 catlfish @@ -54,12 +63,12 @@ RUN useradd --uid 147 --gid 147 catlfish # /var/run/catlfish and not in /usr/local/etc/catlfish, so symlink. RUN mkdir /var/run/catlfish WORKDIR /var/run/catlfish -RUN mkdir erlang_log sasl_log supervisord_log +RUN mkdir erlang_log sasl_log merge_log RUN chown -R catlfish:catlfish /var/run/catlfish RUN ln -s /usr/local/etc/catlfish/catlfish.config /var/run/catlfish/ -# Run supervisord. -ADD supervisord.conf /etc/supervisor/ +ADD merge.sh /usr/local/catlfish/ +ADD start.sh /var/run/catlfish/ WORKDIR /var/run/catlfish USER catlfish -CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] +ENTRYPOINT ["/var/run/catlfish/start.sh"] |