Skip to content

Commit

Permalink
Simplify clj tools setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ccfontes authored Dec 18, 2023
1 parent 25149a5 commit 05d7374
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

= faas-bb image:{img-ci-tests-status}[link={url-ci-status-tests}] image:{img-ci-hadolint-status}[link={url-ci-status-hadolint}] image:{img-ci-clj-kondo-status}[link={url-ci-status-clj-kondo}] image:{img-license}[link=LICENSE]

An https://github.com/openfaas[OpenFaaS] template for writing Functions in https://babashka.org[Babashka].
An https://github.com/openfaas[OpenFaaS] template for writing Functions in https://babashka.org[Babashka] (v1.3.186).

== Why Babashka for OpenFaaS?

Expand Down
10 changes: 3 additions & 7 deletions template/bb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/openfaas/of-watchdog:0.9.13 AS watchdog
FROM babashka/babashka:1.3.186 AS babashka
FROM clojure:tools-deps-1.11.1.1347 AS build
FROM eclipse-temurin:8u392-b08-jdk AS build

RUN set -e

Expand All @@ -12,12 +12,7 @@ ENV PATH="$PATH:/usr/local/bin"
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
COPY --from=babashka /usr/local/bin/bb /usr/local/bin/bb

# /root/.m2 provides: clojure, core.specs.alpha, and spec.alpha
RUN addgroup --system app && adduser --system --ingroup app app && \
mkdir -p $HOME/.deps.clj/1.11.1.1347/ClojureTools && \
mv /root/.m2 $HOME && \
chown app:app -R $HOME && \
mv /usr/local/lib/clojure/libexec/clojure-tools-1.11.1.1347.jar $HOME/.deps.clj/1.11.1.1347/ClojureTools
RUN addgroup --system app && adduser --system --ingroup app app

USER app
WORKDIR $HOME
Expand All @@ -26,6 +21,7 @@ COPY --chown=app:app index.clj bb.edn lib merge_config.clj ./

COPY --chown=app:app function/bb.edn* function/bb.edn
RUN bb merge-config --src "function/bb.edn" --out "ship.edn" && \
mkdir ~/.m2 && \
bb --config ship.edn prepare && \
bb --config ship.edn print-deps && \
cp -r .m2 .m2-ship
Expand Down

0 comments on commit 05d7374

Please sign in to comment.