From 65c1aa57fe8eff0b4e13c6e5bf233d87f2147415 Mon Sep 17 00:00:00 2001 From: vcarroy Date: Fri, 28 Mar 2025 13:54:35 +0100 Subject: [PATCH] feat (docker) : add standalone docker image --- README.md | 6 ++++++ misc/image/Dockerfile | 21 +++++++++++++++++++++ misc/image/mktools | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 misc/image/Dockerfile create mode 100755 misc/image/mktools diff --git a/README.md b/README.md index b41d3b7..f62c747 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,12 @@ Tâches [Make](https://fr.wikipedia.org/wiki/Make) génériques à utiliser de p 3. Vous pouvez commencer à utiliser les tâches Make partagées ! +### Utilisation standalone +1. Lancer l'image docker en créant un volume avec les fichers de votre projet dans /code +``` +docker run -it -v $PWD:/code reg.cadoles.com/cadoles/mktools:1.0 mkt-project-version +``` + ## Tâches disponibles |Tâches|Description|Documentation| diff --git a/misc/image/Dockerfile b/misc/image/Dockerfile new file mode 100644 index 0000000..03f623d --- /dev/null +++ b/misc/image/Dockerfile @@ -0,0 +1,21 @@ +FROM alpine:3.21 + +RUN apk update --no-cache \ + && apk add --no-cache \ + make \ + curl \ + bash \ + git \ + && mkdir /mktools + +COPY ./tasks/* mktools/ + +RUN touch /mktools/Makefile \ + && echo "-include /mktools/*.mk" >> /mktools/Makefile \ + && mkdir /code \ + && git config --global --add safe.directory /code + +WORKDIR /code + +COPY --chmod=550 ./misc/image/mktools /usr/local/bin/mktools +ENTRYPOINT [ "mktools" ] diff --git a/misc/image/mktools b/misc/image/mktools new file mode 100755 index 0000000..18ad492 --- /dev/null +++ b/misc/image/mktools @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +make -f /mktools/Makefile $1 \ No newline at end of file