<!--

********************************************************************************

WARNING:

    DO NOT EDIT "clojure/README.md"

    IT IS AUTO-GENERATED

    (from the other files in "clojure/" combined with a set of templates)

********************************************************************************

-->

# Quick reference

-	**Maintained by**:  
	[the Docker Community](https://github.com/Quantisan/docker-clojure)

-	**Where to get help**:  
	[the Docker Community Forums](https://forums.docker.com/), [the Docker Community Slack](https://dockr.ly/slack), or [Stack Overflow](https://stackoverflow.com/search?tab=newest&q=docker)

# Supported tags and respective `Dockerfile` links

-	[`latest`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-jammy/latest/Dockerfile)
-	[`temurin-8-boot-2.8.3-alpine`, `temurin-8-boot-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-alpine/boot/Dockerfile)
-	[`temurin-8-boot-2.8.3-focal`, `temurin-8-boot-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-focal/boot/Dockerfile)
-	[`temurin-8-boot`, `temurin-8-boot-2.8.3`, `temurin-8-boot-2.8.3-jammy`, `temurin-8-boot-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-jammy/boot/Dockerfile)
-	[`temurin-8-lein-2.9.10-alpine`, `temurin-8-lein-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-alpine/lein/Dockerfile)
-	[`temurin-8-lein-2.9.10-focal`, `temurin-8-lein-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-focal/lein/Dockerfile)
-	[`temurin-8-lein`, `temurin-8-lein-2.9.10`, `temurin-8-lein-2.9.10-jammy`, `temurin-8-lein-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-jammy/lein/Dockerfile)
-	[`temurin-8-alpine`, `temurin-8-tools-deps-1.11.1.1155-alpine`, `temurin-8-tools-deps-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-alpine/tools-deps/Dockerfile)
-	[`temurin-8-focal`, `temurin-8-tools-deps-1.11.1.1155-focal`, `temurin-8-tools-deps-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-focal/tools-deps/Dockerfile)
-	[`temurin-8-jammy`, `temurin-8-tools-deps`, `temurin-8-tools-deps-1.11.1.1155`, `temurin-8-tools-deps-1.11.1.1155-jammy`, `temurin-8-tools-deps-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-8-jdk-jammy/tools-deps/Dockerfile)
-	[`temurin-11-boot-2.8.3-alpine`, `temurin-11-boot-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-alpine/boot/Dockerfile)
-	[`temurin-11-boot-2.8.3-focal`, `temurin-11-boot-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-focal/boot/Dockerfile)
-	[`temurin-11-boot`, `temurin-11-boot-2.8.3`, `temurin-11-boot-2.8.3-jammy`, `temurin-11-boot-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-jammy/boot/Dockerfile)
-	[`temurin-11-lein-2.9.10-alpine`, `temurin-11-lein-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-alpine/lein/Dockerfile)
-	[`temurin-11-lein-2.9.10-focal`, `temurin-11-lein-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-focal/lein/Dockerfile)
-	[`temurin-11-lein`, `temurin-11-lein-2.9.10`, `temurin-11-lein-2.9.10-jammy`, `temurin-11-lein-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-jammy/lein/Dockerfile)
-	[`temurin-11-alpine`, `temurin-11-tools-deps-1.11.1.1155-alpine`, `temurin-11-tools-deps-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-alpine/tools-deps/Dockerfile)
-	[`temurin-11-focal`, `temurin-11-tools-deps-1.11.1.1155-focal`, `temurin-11-tools-deps-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-focal/tools-deps/Dockerfile)
-	[`temurin-11-jammy`, `temurin-11-tools-deps`, `temurin-11-tools-deps-1.11.1.1155`, `temurin-11-tools-deps-1.11.1.1155-jammy`, `temurin-11-tools-deps-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-11-jdk-jammy/tools-deps/Dockerfile)
-	[`boot-2.8.3-alpine`, `boot-alpine`, `temurin-17-boot-2.8.3-alpine`, `temurin-17-boot-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-alpine/boot/Dockerfile)
-	[`boot-2.8.3-focal`, `boot-focal`, `temurin-17-boot-2.8.3-focal`, `temurin-17-boot-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-focal/boot/Dockerfile)
-	[`boot`, `boot-2.8.3`, `boot-2.8.3-jammy`, `boot-jammy`, `temurin-17-boot`, `temurin-17-boot-2.8.3`, `temurin-17-boot-2.8.3-jammy`, `temurin-17-boot-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-jammy/boot/Dockerfile)
-	[`lein-2.9.10-alpine`, `lein-alpine`, `temurin-17-lein-2.9.10-alpine`, `temurin-17-lein-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-alpine/lein/Dockerfile)
-	[`lein-2.9.10-focal`, `lein-focal`, `temurin-17-lein-2.9.10-focal`, `temurin-17-lein-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-focal/lein/Dockerfile)
-	[`lein`, `lein-2.9.10`, `lein-2.9.10-jammy`, `lein-jammy`, `temurin-17-lein`, `temurin-17-lein-2.9.10`, `temurin-17-lein-2.9.10-jammy`, `temurin-17-lein-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-jammy/lein/Dockerfile)
-	[`temurin-17-alpine`, `temurin-17-tools-deps-1.11.1.1155-alpine`, `temurin-17-tools-deps-alpine`, `tools-deps-1.11.1.1155-alpine`, `tools-deps-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-alpine/tools-deps/Dockerfile)
-	[`temurin-17-focal`, `temurin-17-tools-deps-1.11.1.1155-focal`, `temurin-17-tools-deps-focal`, `tools-deps-1.11.1.1155-focal`, `tools-deps-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-focal/tools-deps/Dockerfile)
-	[`temurin-17-jammy`, `temurin-17-tools-deps`, `temurin-17-tools-deps-1.11.1.1155`, `temurin-17-tools-deps-1.11.1.1155-jammy`, `temurin-17-tools-deps-jammy`, `tools-deps`, `tools-deps-1.11.1.1155`, `tools-deps-1.11.1.1155-jammy`, `tools-deps-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-17-jdk-jammy/tools-deps/Dockerfile)
-	[`temurin-18-boot-2.8.3-alpine`, `temurin-18-boot-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-alpine/boot/Dockerfile)
-	[`temurin-18-boot-2.8.3-focal`, `temurin-18-boot-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-focal/boot/Dockerfile)
-	[`temurin-18-boot`, `temurin-18-boot-2.8.3`, `temurin-18-boot-2.8.3-jammy`, `temurin-18-boot-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-jammy/boot/Dockerfile)
-	[`temurin-18-lein-2.9.10-alpine`, `temurin-18-lein-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-alpine/lein/Dockerfile)
-	[`temurin-18-lein-2.9.10-focal`, `temurin-18-lein-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-focal/lein/Dockerfile)
-	[`temurin-18-lein`, `temurin-18-lein-2.9.10`, `temurin-18-lein-2.9.10-jammy`, `temurin-18-lein-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-jammy/lein/Dockerfile)
-	[`temurin-18-alpine`, `temurin-18-tools-deps-1.11.1.1155-alpine`, `temurin-18-tools-deps-alpine`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-alpine/tools-deps/Dockerfile)
-	[`temurin-18-focal`, `temurin-18-tools-deps-1.11.1.1155-focal`, `temurin-18-tools-deps-focal`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-focal/tools-deps/Dockerfile)
-	[`temurin-18-jammy`, `temurin-18-tools-deps`, `temurin-18-tools-deps-1.11.1.1155`, `temurin-18-tools-deps-1.11.1.1155-jammy`, `temurin-18-tools-deps-jammy`](https://github.com/Quantisan/docker-clojure/blob/fb4211fa077d8202b47170e2554d7bafa2765daa/target/eclipse-temurin-18-jdk-jammy/tools-deps/Dockerfile)

# Quick reference (cont.)

-	**Where to file issues**:  
	[https://github.com/Quantisan/docker-clojure/issues](https://github.com/Quantisan/docker-clojure/issues)

-	**Supported architectures**: ([more info](https://github.com/docker-library/official-images#architectures-other-than-amd64))  
	[`amd64`](https://hub.docker.com/r/amd64/clojure/), [`arm64v8`](https://hub.docker.com/r/arm64v8/clojure/)

-	**Published image artifact details**:  
	[repo-info repo's `repos/clojure/` directory](https://github.com/docker-library/repo-info/blob/master/repos/clojure) ([history](https://github.com/docker-library/repo-info/commits/master/repos/clojure))  
	(image metadata, transfer size, etc)

-	**Image updates**:  
	[official-images repo's `library/clojure` label](https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fclojure)  
	[official-images repo's `library/clojure` file](https://github.com/docker-library/official-images/blob/master/library/clojure) ([history](https://github.com/docker-library/official-images/commits/master/library/clojure))

-	**Source of this description**:  
	[docs repo's `clojure/` directory](https://github.com/docker-library/docs/tree/master/clojure) ([history](https://github.com/docker-library/docs/commits/master/clojure))

# What is Clojure?

Clojure is a dialect of the Lisp programming language. It is a general-purpose programming language with an emphasis on functional programming. It runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines. Like other Lisps, Clojure treats code as data and has a macro system.

> [wikipedia.org/wiki/Clojure](http://en.wikipedia.org/wiki/Clojure)

![logo](https://raw.githubusercontent.com/docker-library/docs/665526c3b12cedfd721234cedb61e8433f73b75a/clojure/logo.png)

# How to use this image

## Build tools

Clojure has three major approaches to building and running projects:

1.	[leiningen](https://leiningen.org)
	1.	The oldest and probably most common tool
2.	[boot](http://boot-clj.com)
	1.	An alternative approach that solves similar problems as leiningen
3.	[tools-deps](https://clojure.org/guides/deps_and_cli)
	1.	A more recent official tool for some of the lein/boot use cases

There are variants of this image for all three of these tools and their respective releases. The most basic form of these tags is:

1.	`clojure:lein`
2.	`clojure:boot`
3.	`clojure:tools-deps`

But you can also append a hyphen and the version of that tool you'd like to use. For example, for lein 2.8.1 you can use this image: `clojure:lein-2.8.1`.

## Run your app with leiningen

Add a `Dockerfile` to an existing Leiningen/Clojure project with the following contents:

```dockerfile
FROM clojure
COPY . /usr/src/app
WORKDIR /usr/src/app
CMD ["lein", "run"]
```

Then, run these commands to build and run the image:

```console
$ docker build -t my-clojure-app .
$ docker run -it --rm --name my-running-app my-clojure-app
```

While the above is the most straightforward example of a `Dockerfile`, it does have some drawbacks. The `lein run` command will download your dependencies, compile the project, and then run it. That's a lot of work, all of which you may not want done every time you run the image. To get around this, you can download the dependencies and compile the project ahead of time. This will significantly reduce startup time when you run your image.

```dockerfile
FROM clojure
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
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')" app-standalone.jar
CMD ["java", "-jar", "app-standalone.jar"]
```

Writing the `Dockerfile` this way will download the dependencies (and cache them, so they are only re-downloaded when the dependencies change) and then compile them into a standalone jar ahead of time rather than each time the image is run.

You can then build and run the image as above.

## Compile your Lein/Clojure project into a jar from within the container

If you have an existing Lein/Clojure project, it's fairly straightforward to compile your project into a jar from a container:

```console
$ docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app clojure lein uberjar
```

This will build your project into a jar file located in your project's `target/uberjar` directory.

## More details

See [the official image README](https://github.com/Quantisan/docker-clojure/blob/master/README.md) for more details about using this image with boot and tools-deps.

# Image Variants

The `clojure` images come in many flavors, each designed for a specific use case.

## `clojure:<version>`

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

Some of these tags may have names like focal or jammy in them. These are the suite code names for releases of [Ubuntu](https://wiki.ubuntu.com/Releases) and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Ubuntu.

## `clojure:<version>-alpine`

This image is based on the popular [Alpine Linux project](https://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use [musl libc](https://musl.libc.org) instead of [glibc and friends](https://www.etalabs.net/compare_libcs.html), so software will often run into issues depending on the depth of their libc requirements/assumptions. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).

# License

View [license information](http://clojure.org/license) for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

Some additional license information which was able to be auto-detected might be found in [the `repo-info` repository's `clojure/` directory](https://github.com/docker-library/repo-info/tree/master/repos/clojure).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
