Public Repository

Last pushed: 3 years ago
Short Description
A small (167.3 MB) image based on Busybox with JDK8, Lein and Clojure included.
Full Description

Working with this image

Getting a REPL

An easy way to explore this container for the first time is to run a REPL:

$ docker run -it garycrawford/busybox-clojure lein repl

A base for a Clojure app container

To use this container as a base for a container in which you run your Clojure application simply add the following Dockerfile to the root of your Clojure project:

FROM garycrawford/busybox-clojure

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# copying the project file and running `lein deps` as a separate step
# ensures this only runs when new dependencies are required
COPY project.clj /usr/src/app/
RUN lein deps

COPY . /usr/src/app
RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" \

CMD ["java", "-jar", "app-standalone.jar"]

To build your application container and then run the application:

# this command should be run from the root of your application
$ docker build -t my-clojure-app .

# once the container is built this command can be run from any location
$ docker run -it --rm --name my-running-app my-clojure-app
Docker Pull Command