From 1b29bdb2d368f2f3ec34429fcddaed9fe0a8bc4f Mon Sep 17 00:00:00 2001 From: jmoore Date: Fri, 15 Dec 2017 17:45:51 +0000 Subject: [PATCH 1/2] Add Dockerfile for ImageJ.app Intent of this dockerfile is to build ImageJ locally without downloading any pre-built versions (zips or update sites). This strategy can be repeated in down- stream repositories either by following a similar strategy or by using this built image as a parent. --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..b6da5fabaf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# Development Dockerfile for ImageJ +# --------------------------------- +# This dockerfile can be used to build an +# ImageJ.app directory which can then be run +# within a number of different Docker images. + +# By default, building this dockerfile will use +# the IMAGE argument below for the runtime image. +ARG IMAGE=openjdk:8-jre-alpine + +# To install the built ImageJ.app into other runtimes +# pass a build argument, e.g.: +# +# docker build --build-arg IMAGE=openjdk:9 ... +# + +# Similarly, the MAVEN_IMAGE argument can be overwritten +# but this is generally not needed. +ARG MAVEN_IMAGE=maven:3.5-jdk-8 + +# +# Build phase: Use the maven image for building. +# +FROM ${MAVEN_IMAGE} as maven +RUN adduser ij +COPY . /src +RUN chown -R ij /src +USER ij +WORKDIR /src +RUN bin/populate-app.sh + +# +# Install phase: Copy the build ImageJ.app into a +# clean container to minimize size. +# +FROM ${IMAGE} +COPY --from=maven /src/ImageJ.app /ImageJ.app +ENV PATH $PATH:/ImageJ.app +ENTRYPOINT ["ImageJ-linux64"] From 8f77b0b462371761af0a2bd526f715ba2a7e3655 Mon Sep 17 00:00:00 2001 From: jmoore Date: Fri, 15 Dec 2017 17:56:55 +0000 Subject: [PATCH 2/2] Add .dockerignore to prevent rebuilds --- .dockerignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..6b8710a711 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.git