diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b8085b3c..b3178b881 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Build and push Docker image + - name: Build and push Docker images uses: docker/build-push-action@v5 with: context: . @@ -51,3 +51,16 @@ jobs: tags: | ${{ secrets.DOCKERHUB_USERNAME }}/aider:${{ github.ref_name }} ${{ secrets.DOCKERHUB_USERNAME }}/aider:latest + target: aider + + - name: Build and push Docker full image + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/aider-full:${{ github.ref_name }} + ${{ secrets.DOCKERHUB_USERNAME }}/aider-full:latest + target: aider-full diff --git a/docker/Dockerfile b/docker/Dockerfile index 72c4f8006..a4eddc338 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,16 +1,23 @@ -FROM python:3.10-slim - -COPY . /aider - -# Unfortunately to build the multi-arch docker image we need `build-essential` for amd64. -# Apparently py-tree-sitter-languages doesn't have a pre-built binary wheel? -# Apparently Playwright needs build-essentials too. +FROM python:3.10-slim AS base RUN apt-get update && \ apt-get install --no-install-recommends -y build-essential git libportaudio2 && \ - rm -rf /var/lib/apt/lists/* && \ - pip install --no-cache-dir /aider --extra-index-url https://download.pytorch.org/whl/cpu && \ - rm -rf /aider - + rm -rf /var/lib/apt/lists/* + WORKDIR /app -ENTRYPOINT ["aider"] \ No newline at end of file + +FROM base AS aider-full + +COPY . /aider +RUN pip install --no-cache-dir /aider[help,browser] --extra-index-url https://download.pytorch.org/whl/cpu && \ + rm -rf /aider + +ENTRYPOINT ["aider"] + +FROM base AS aider + +COPY . /aider +RUN pip install --no-cache-dir /aider --extra-index-url https://download.pytorch.org/whl/cpu && \ + rm -rf /aider + +ENTRYPOINT ["aider"]