DEV Community

José Luis Lafuente
José Luis Lafuente

Posted on • Originally published at lafuente.me on

1 3

GitHub actions with Docker and Nix

I created my first GitHub action: clojars publish action.

To see an example in action, you can go to jlesquembre/dummy-clj and take a look to the actions tab.

GitHub actions can run in Docker containers, so I created a Docker image. At first, I went to Docker hub and looked for the clojure images, but I realized that I also needed to install maven. There is also a maven image, but since I need maven and clojure on the container, the only option was to create my own image based on the official ones and install the other dependency manually.

Then, I remembered about an interesting project I hear about, Nixery. With it, you can create Docker images based on NixOS, and it makes really easy to install dependecies. In my case, I just needed this:

FROM nixery.dev/shell/maven/clojure

Done, you alredy have a container with some basic linux utilities, maven and clojure. If you need to install something else, just add /other-dep.

Since I'm already a NixOS user, it is a really good solution for me. It gives me an easy way to install dependecies, on the linux distribution I know the best.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay