diff --git a/.github/workflows/functionality-helm-chart.yml b/.github/workflows/functionality-helm-chart.yml index b138a09..7496205 100644 --- a/.github/workflows/functionality-helm-chart.yml +++ b/.github/workflows/functionality-helm-chart.yml @@ -28,6 +28,8 @@ jobs: - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - run: echo "🖥️ The workflow is now ready to test your code on the runner." - name: Deploy via helm charts + env: + DOCKER_BUILDKIT: 1 run: | cd ${{ github.workspace }} sudo docker build -t localhost:5000/git-act-router -f docker/Dockerfile . diff --git a/docker/Dockerfile b/docker/Dockerfile index 1f8ec46..cfdb6c6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,15 +2,21 @@ FROM python:3.10-slim WORKDIR /app -# Copy only the setup.py first to leverage Docker layer caching +# hadolint ignore=DL3008 +RUN --mount=type=cache,target=/var/lib/apt --mount=type=cache,target=/var/cache/apt \ + apt-get update && \ + apt-get install -y --no-install-recommends git && \ + rm -rf /var/lib/apt/lists/* + +# Copy the setup.dot py and the git metadata first (leverage Docker layer caching) COPY setup.py . +COPY .git/ .git/ # Copy the rest of the application code COPY src/ src/ -# Install dependencies (no cache to reduce size) -RUN --mount=type=cache,target=/root/.cache/pip \ - pip install --no-cache-dir --upgrade pip setuptools_scm && \ +# Install dependencies (use cache, and delete after install, to speed up the build) +RUN pip install --upgrade --no-cache-dir pip setuptools_scm && \ pip install --no-cache-dir . # Set the entrypoint