adzerk/boot-clj
is a public Docker image that installs and sets up Oracle
Java 8 and the latest version of Boot.
This repo is set up as an automated build on Docker Hub. The
adzerk/boot-clj
Docker image is automatically built from the Dockerfile
in this repo and deployed to Docker Hub.
$ docker run -it adzerk/boot-clj repl
To use as a base image for another Dockerfile, put this at the top of your Dockerfile:
FROM adzerk/boot-clj:latest
The image is constructed to cache Maven artifacts in /m2, and Boot JAR files in /.boot in the container. You can cache these things at build time in your container by adding commands similar to the following to your Dockerfile:
RUN boot <yourtask>
Assuming that yourtask doesn't block the Boot pipeline it will exit, but not before downloading all of its dependencies into the Maven repository in the container. This way it won't need to download them at runtime.
You can use any version of Boot with this image by specifying the
BOOT_VERSION
. You can do this in a couple of ways:
- You can make a boot.properties file in your project that specifies the version of Boot and/or Clojure to use,
- or you can set the
BOOT_VERSION
and/orBOOT_CLOJURE_VERSION
environment variables in your Dockerfile.
boot.properties
BOOT_VERSION=2.3.0
BOOT_CLOJURE_VERSION=1.6.0
Dockerfile
ENV BOOT_VERSION=2.3.0
ENV BOOT_CLOJURE_VERSION=1.6.0
Environment variables set in the Dockerfile will override settings in the boot.properties file.