From 4c8f508b496c9f6e4371dfd1a9ce986a510aa05b Mon Sep 17 00:00:00 2001 From: Santiago Fraire Date: Thu, 25 Apr 2024 14:46:26 +0200 Subject: [PATCH] FIX: Set safe dir in docker image --- .cz.toml | 3 ++- Dockerfile | 5 +++-- README.md | 7 +++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.cz.toml b/.cz.toml index 7b5a5df..9ba857b 100644 --- a/.cz.toml +++ b/.cz.toml @@ -4,7 +4,8 @@ version_provider = "poetry" version_files = [ "scripts/build", "CONTIRBUTING.md", - "Dockerfile:cz-kpn==" + "Dockerfile:cz-kpn==", + "README.md:^docker" ] bump_message = "BUMP: version $current_version → $new_version" commit_url = "https://github.com/kpn/cz-kpn/commit/$COMMIT_REV" diff --git a/Dockerfile b/Dockerfile index e9fb18a..6d6a196 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,15 @@ FROM python:3-alpine LABEL org.label-schema.name="kpnnl/cz-kpn" LABEL org.label-schema.description="KPN'S COMMITIZEN" - +LABEL org.opencontainers.image.source="https://github.com/kpn/cz-kpn" WORKDIR /app RUN apk add --update -t --no-cache git curl alpine-sdk RUN ["pip", "install", "-U", "--no-cache-dir", "pip"] RUN ["pip", "install", "-U", "--no-cache-dir", "cz-kpn==3.2.8"] +RUN ["git", "config", "--global", "--add", "safe.directory", "/app"] ##### run ENTRYPOINT [ "/bin/sh", "-c" ] -CMD [ "cz -n cz_kpn --help" ] +CMD [ "cz", "-n", "cz_kpn", "--help" ] \ No newline at end of file diff --git a/README.md b/README.md index f2967fd..d16c789 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,13 @@ or the shortcut cz c ``` +### With docker + +```sh +docker run --rm -it -v $(pwd):/app kpnnl/cz-kpn:3.2.8 'cz -n cz_kpn commit' +``` + + ## Features ### Client tool to assist in the creation of a commit