Updated Dockerfile

Set to use a newer JRuby
Added an environment variable for the log file location
Changed entrypoint to cmd to add flexibility
Added missing trailing slash to copy command path
This commit is contained in:
Gene Liverman 2017-06-12 13:27:36 -07:00
parent 1fcb19bd7b
commit dea5c4e962
No known key found for this signature in database
GPG key ID: DF2861847B55C749

View file

@ -8,24 +8,25 @@
# RUN:
# docker run -e VMPOOLER_CONFIG -p 80:4567 -it vmpooler
FROM jruby:1.7-jdk
FROM jruby:9.1-jdk
RUN mkdir -p /var/lib/vmpooler && mkdir /var/log/vmpooler
RUN mkdir -p /var/lib/vmpooler
WORKDIR /var/lib/vmpooler
ADD Gemfile* /var/lib/vmpooler
ADD Gemfile* /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
RUN apt-get update && apt-get install -y redis-server && rm -rf /var/lib/apt/lists/*
COPY . /var/lib/vmpooler
ENTRYPOINT \
ENV VMPOOLER_LOG /var/log/vmpooler.log
CMD \
/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
&& while [ ! -f ${VMPOOLER_LOG} ]; do sleep 1; done ; \
tail -f ${VMPOOLER_LOG}