From c43a4eddaa5cae65eebfdd6caf7cfd6eb7ab7e5a Mon Sep 17 00:00:00 2001 From: Wes Morgan Date: Mon, 5 Nov 2018 11:58:42 -0700 Subject: [PATCH 1/2] Add info about boot and tools-deps variants of clojure image --- clojure/content.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/clojure/content.md b/clojure/content.md index 6011e6e10..7583d8a81 100644 --- a/clojure/content.md +++ b/clojure/content.md @@ -8,9 +8,31 @@ Clojure is a dialect of the Lisp programming language. It is a general-purpose p # How to use this image -## Start a Lein/Clojure instance in your app +## Build tools -Since the most common way to use Clojure is in conjunction with [Leiningen (`lein`)](http://leiningen.org/), this image assumes that's how you'll be working. The most straightforward way to use this image is to add a `Dockerfile` to an existing Leiningen/Clojure project: +Clojure has three major approaches to building and running projects: + +1. [leiningen](https://leiningen.org) + 1. The oldest and probably most common tool +1. [boot](http://boot-clj.com) + 1. An alternative approach that solves similar problems as leiningen +1. [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` +1. `clojure:boot` +1. `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 %%IMAGE%% @@ -26,7 +48,12 @@ $ 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. +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 %%IMAGE%% @@ -52,3 +79,8 @@ $ docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app %%IMAGE%% lein uber ``` 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. From dec451c30e5fc92c8a9208bca3fec8ccd858eb59 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 19 Nov 2018 07:42:16 -0800 Subject: [PATCH 2/2] Fix formatting --- clojure/content.md | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/clojure/content.md b/clojure/content.md index 7583d8a81..205309c71 100644 --- a/clojure/content.md +++ b/clojure/content.md @@ -12,27 +12,24 @@ Clojure is a dialect of the Lisp programming language. It is a general-purpose p Clojure has three major approaches to building and running projects: -1. [leiningen](https://leiningen.org) - 1. The oldest and probably most common tool -1. [boot](http://boot-clj.com) - 1. An alternative approach that solves similar problems as leiningen -1. [tools-deps](https://clojure.org/guides/deps_and_cli) - 1. A more recent official tool for some of the lein/boot use cases +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: +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` -1. `clojure:boot` -1. `clojure:tools-deps` +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`. +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: +Add a `Dockerfile` to an existing Leiningen/Clojure project with the following contents: ```dockerfile FROM %%IMAGE%% @@ -48,12 +45,7 @@ $ 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. +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 %%IMAGE%% @@ -82,5 +74,4 @@ This will build your project into a jar file located in your project's `target/u ## 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. +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.