Permalink
Browse files

Update Dockerfile to build from source.

This means that we can build HEAD releases of DFBnc, and
removes the need to update the Dockerfile in each branch.

Key changes:

 - Instead of checking out from git, copy most of the DFBnc
   directory into the image. This ensures we build the right
   branch.

 - Add a .dockerignore file to avoid putting things in the
   context that aren't needed for the build.

 - Use the java:jdk base image, as this correctly sets up
   the locale and saves apt-getting a bunch of things.

 - Keep the jar file lowercase, as that's what the build
   produces.

Fixes #106
  • Loading branch information...
csmith committed Aug 9, 2016
1 parent 7d22d7e commit 66c49610cf324ab412ec1f1caaa2695275d87414
Showing with 17 additions and 6 deletions.
  1. +4 −0 .dockerignore
  2. +13 −6 Dockerfile
View
@@ -0,0 +1,4 @@
build
dist
test
DFBnc
View
@@ -1,18 +1,25 @@
FROM ubuntu:xenial
FROM java:8-jdk
MAINTAINER Shane Mc Cormack <dataforce@dataforce.org.uk>
RUN \
apt-get update && \
apt-get -y install \
curl \
openjdk-8-jre-headless
apt-get -y install ant && \
rm -rf /var/lib/apt/lists/*
RUN curl -L -o /DFBnc.jar https://github.com/ShaneMcC/DFBnc/releases/download/0.4.1/dfbnc.jar
COPY . /dfbnc/
RUN \
cd /dfbnc && \
git submodule update --init --recursive && \
ant jar && \
mv /dfbnc/dist/dfbnc.jar / && \
rm -rf /dfbnc && \
apt-get -y purge ant
EXPOSE 33262 33263
VOLUME ["/var/lib/dfbnc"]
WORKDIR /var/lib/dfbnc
CMD ["/usr/bin/java", "-jar", "/DFBnc.jar", "--config", "/var/lib/dfbnc", "--foreground"]
CMD ["/usr/bin/java", "-jar", "/dfbnc.jar", "--config", "/var/lib/dfbnc", "--foreground"]

0 comments on commit 66c4961

Please sign in to comment.