From c5aedc12cb907198ab70226ce94e1271eedb92a8 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Sat, 19 Nov 2016 09:54:42 -0800 Subject: [PATCH] Add an all-in-one Dockerfile Built off the [jruby](https://hub.docker.com/_/jruby/) `Dockerfile`, it installs gem requirements via `bundler`, installs and runs a `redis-server`, imports the current working directory, starts `vmpooler`, and tails the logfile. Creating a `vmpooler.yaml` configuration file in the current working directory and running the following provides a development environment: ``` docker build -t vmpooler . && docker run -p 80:4567 -it vmpooler ``` --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3cad897 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM jruby:1.7-jdk + +RUN mkdir -p /var/lib/vmpooler +WORKDIR /var/lib/vmpooler + +ADD Gemfile /var/lib/vmpooler +ADD Gemfile.lock /var/lib/vmpooler +RUN bundle install --system + +RUN ln -s /opt/jruby/bin/jruby /usr/bin/jruby + +RUN echo "deb http://httpredir.debian.org/debian jessie main" >/etc/apt/sources.list.d/jessie-main.list +RUN apt-get update +RUN apt-get install -y redis-server + +COPY . /var/lib/vmpooler + +ENTRYPOINT \ + /etc/init.d/redis-server start \ + && /var/lib/vmpooler/scripts/vmpooler_init.sh start \ + && while [ ! -f /var/log/vmpooler.log ]; do sleep 1; done ; \ + tail -f /var/log/vmpooler.log