Skip to content

Commit 0e5ea85

Browse files
committed
proxy: Fix mount cache corruption during multi-arch build instead of
setting "sharing=locked"
1 parent ff797f7 commit 0e5ea85

2 files changed

Lines changed: 51 additions & 4 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ jobs:
5656
- name: Fix Dockerfile for backend image
5757
if: matrix.package.image == 'piped-backend'
5858
run: sed -i '/COPY VERSION/d' Dockerfile
59-
- name: Fix Dockerfile for proxy image
60-
if: matrix.package.image == 'piped-proxy'
61-
run: sed -i 's|--mount=type=cache,target=|--mount=type=cache,sharing=locked,target=|' Dockerfile
6259
- name: Checkout this repository for frontend patches
63-
if: matrix.package.image == 'piped-frontend'
60+
if: matrix.package.image == 'piped-frontend' || matrix.package.image == 'piped-proxy'
6461
uses: actions/checkout@v4
6562
with:
6663
path: piped-docker
6764
- name: Apply frontend patches
6865
if: matrix.package.image == 'piped-frontend'
6966
run: git apply piped-docker/patches/frontend/*.patch
67+
- name: Apply proxy patches
68+
if: matrix.package.image == 'piped-proxy'
69+
run: git apply piped-docker/patches/proxy/*.patch
7070
- name: '[frontend] Disable linter'
7171
if: matrix.package.image == 'piped-frontend'
7272
run: sed -i '/eslint/d' vite.config.js
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From e650ba35675f3dd6b9950b1d310bb39c3bb7a528 Mon Sep 17 00:00:00 2001
2+
From: DEREFERENC3D <DEREFERENC3D@protonmail.com>
3+
Date: Fri, 10 Jul 2026 17:40:49 +0200
4+
Subject: [PATCH 1/1] Dockerfile: Assign arch-dependent IDs for each cache
5+
6+
Fixes mount cache corruption between builds for different architectures.
7+
---
8+
Dockerfile | 10 ++++++----
9+
1 file changed, 6 insertions(+), 4 deletions(-)
10+
11+
diff --git a/Dockerfile b/Dockerfile
12+
index 0a6c07e..e8ee63f 100644
13+
--- a/Dockerfile
14+
+++ b/Dockerfile
15+
@@ -1,23 +1,25 @@
16+
FROM rust:slim as BUILD
17+
18+
+ARG TARGETARCH
19+
+
20+
WORKDIR /app/
21+
22+
COPY . .
23+
24+
-RUN --mount=type=cache,target=/var/cache/apt \
25+
+RUN --mount=type=cache,id=apt-${TARGETARCH},target=/var/cache/apt \
26+
apt-get update && \
27+
apt-get install -y --no-install-recommends \
28+
nasm && \
29+
rm -rf /var/lib/apt/lists/*
30+
31+
-RUN --mount=type=cache,target=/usr/local/cargo/registry \
32+
- --mount=type=cache,target=/app/target/ \
33+
+RUN --mount=type=cache,id=cargo-registry-${TARGETARCH},target=/usr/local/cargo/registry \
34+
+ --mount=type=cache,id=cargo-build-${TARGETARCH},target=/app/target/ \
35+
cargo build --release && \
36+
mv target/release/piped-proxy .
37+
38+
FROM debian:stable-slim
39+
40+
-RUN --mount=type=cache,target=/var/cache/apt \
41+
+RUN --mount=type=cache,id=apt-${TARGETARCH},target=/var/cache/apt \
42+
apt-get update && \
43+
apt-get install -y --no-install-recommends \
44+
ca-certificates && \
45+
--
46+
2.55.0
47+

0 commit comments

Comments
 (0)