diff --git a/.dockerignore b/.dockerignore index 6ff11c6..084c45a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,8 @@ .git .gitignore .idea +.hadolint.yml .markdownlint.yml +.releaserc Dockerfile run-ci.sh diff --git a/.hadolint.yml b/.hadolint.yml new file mode 100644 index 0000000..aaaf83c --- /dev/null +++ b/.hadolint.yml @@ -0,0 +1,10 @@ +# Hadolint configuration file + +failure-threshold: info +strict-labels: false + +# configure ignore rules +# see https://github.com/hadolint/hadolint#rules for a list of available rules. +ignored: + - DL3016 + - DL3018 diff --git a/Dockerfile b/Dockerfile index 7a90107..329655a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,12 @@ FROM python:3-alpine3.20 +LABEL org.opencontainers.image.authors="Martin Kock " \ + org.opencontainers.image.url="https://github.com/deeagle/dspyce-demo-app" \ + org.opencontainers.image.licenses="GPL3" \ + org.opencontainers.image.title="dspyce-demo-app" \ + org.opencontainers.image.description="Container which includes a DSpyce-demo to talk to DSpace-Demo." \ + org.opencontainers.image.vendor="deeagle.de" + WORKDIR /app COPY ["requirements.txt", "requirements.txt"] diff --git a/run-ci.sh b/run-ci.sh index c758490..b63a50f 100644 --- a/run-ci.sh +++ b/run-ci.sh @@ -13,6 +13,15 @@ docker run --rm -v "$(pwd):/app" docdee/mdlint -c /app/.markdownlint.yml -i CHAN echo "Lint shell scripts ..." docker run --rm -v "$(pwd):/app" koalaman/shellcheck-alpine:stable find /app -type f -name '*.sh' -exec shellcheck {} + +echo "Lint Dockerfiles ..." +docker_linter_version="$(docker run --rm -i ghcr.io/hadolint/hadolint hadolint -v)" +echo "Using docker-linter version: ${docker_linter_version}" +dockerfiles=$(find . -type f -name "*Dockerfile" -not -path "./vendor/*" -not -path "./tmp/*") +for dockerfile in ${dockerfiles}; do + echo "> lint file: $dockerfile" + docker run --rm -i -v "${PWD}/.hadolint.yml:/.config/hadolint.yml" ghcr.io/hadolint/hadolint < "$dockerfile" +done + echo "Lint code (flake8) ..." echo "> we want O's" # stop the build if there are Python syntax errors or undefined names