diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 4655d415b2..339132c4f0 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -1,18 +1,23 @@ name: Build Docker container on push on: - push: - branches: - - "*" + push: + branches: + - "*" jobs: build: name: Build image - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 + + permissions: + contents: read + packages: write + id-token: write steps: - name: Checkout project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set env variables run: | @@ -21,23 +26,25 @@ jobs: echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 id: qemu - name: Setup Docker buildx action - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 id: buildx - name: Run Docker buildx run: | - docker buildx build \ - --platform linux/amd64,linux/arm64 \ - --tag ghcr.io/$IMAGE_NAME:$BRANCH \ - --output "type=registry" ./ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --tag ghcr.io/$IMAGE_NAME:$BRANCH \ + --cache-from type=gha \ + --cache-to type=gha,mode=max \ + --output "type=registry" ./ diff --git a/.github/workflows/docker-tag.yml b/.github/workflows/docker-tag.yml index ac8208ff9a..98fcc5c271 100644 --- a/.github/workflows/docker-tag.yml +++ b/.github/workflows/docker-tag.yml @@ -9,11 +9,11 @@ on: jobs: build: name: Build image - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set env variables run: | @@ -22,21 +22,23 @@ jobs: echo "IMAGE_NAME=${REPO_OWNER,,}/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Setup Docker buildx action - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Run Docker buildx run: | - docker buildx build \ - --platform linux/amd64,linux/arm64 \ - --tag ghcr.io/$IMAGE_NAME:$TAG \ - --output "type=registry" ./ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --tag ghcr.io/$IMAGE_NAME:$TAG \ + --cache-from type=gha \ + --cache-to type=gha,mode=max \ + --output "type=registry" ./ diff --git a/Dockerfile b/Dockerfile index 0e8b27fb52..d852e3c434 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,25 +9,29 @@ ARG USER=specter ARG DIR=/data/ -FROM python:3.10-slim-bullseye AS builder +FROM python:3.10-bookworm AS builder ARG VERSION ARG REPO -RUN apt update && apt install -y git build-essential libusb-1.0-0-dev libudev-dev libffi-dev libssl-dev rustc cargo libpq-dev +RUN apt update && apt install -y git libusb-1.0-0-dev libudev-dev libffi-dev libssl-dev rustc cargo libpq-dev WORKDIR / WORKDIR /specter-desktop -COPY . . +COPY requirements.txt . RUN pip3 install --upgrade pip RUN pip3 install babel cryptography -RUN pip3 install . +RUN pip3 install -r requirements.txt + +COPY . . + +RUN pip3 install . --no-deps -FROM python:3.10-slim-bullseye as final +FROM python:3.10-slim-bookworm as final ARG USER ARG DIR