fix: docker multiplatform (#383)
* fix: multiplatform build * fix: test build
This commit is contained in:
parent
6da9db489f
commit
497cb40aaf
22
.github/workflows/build-push-docker.yaml
vendored
22
.github/workflows/build-push-docker.yaml
vendored
|
@ -88,34 +88,16 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build docker image (amd64)
|
- name: Build docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64, linux/arm64
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.meta.outputs.tags }}
|
${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
build-args: |
|
|
||||||
ENABLE_GRAPHRAG=true
|
|
||||||
|
|
||||||
- name: Build docker image (arm64)
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
file: Dockerfile
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
platforms: linux/arm64
|
|
||||||
tags: |
|
|
||||||
${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
target: ${{ matrix.target }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
build-args: |
|
|
||||||
ENABLE_GRAPHRAG=false
|
|
||||||
|
|
|
@ -15,13 +15,14 @@ RUN apt-get update -qqy && \
|
||||||
cargo
|
cargo
|
||||||
|
|
||||||
# Setup args
|
# Setup args
|
||||||
ARG ENABLE_GRAPHRAG=true
|
ARG TARGETPLATFORM
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
ENV PYTHONIOENCODING=UTF-8
|
ENV PYTHONIOENCODING=UTF-8
|
||||||
ENV ENABLE_GRAPHRAG=${ENABLE_GRAPHRAG}
|
ENV TARGETARCH=${TARGETARCH}
|
||||||
|
|
||||||
# Create working directory
|
# Create working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
@ -45,7 +46,7 @@ RUN --mount=type=ssh \
|
||||||
|
|
||||||
RUN --mount=type=ssh \
|
RUN --mount=type=ssh \
|
||||||
--mount=type=cache,target=/root/.cache/pip \
|
--mount=type=cache,target=/root/.cache/pip \
|
||||||
if [ "$ENABLE_GRAPHRAG" = "true" ]; then pip install graphrag future; fi
|
if [ "$TARGETARCH" = "amd64" ]; then pip install graphrag future; fi
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
RUN apt-get autoremove \
|
RUN apt-get autoremove \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user