Skip to content

Commit 59191b2

Browse files
committed
fix docker build
1 parent 30961d4 commit 59191b2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/docker-nightly.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ jobs:
6060
run: |
6161
git config --global url."git@github.com:".insteadOf "https://github.com/"
6262
63+
- name: Verify SSH agent and add GitHub to known hosts
64+
run: |
65+
ssh-add -l
66+
mkdir -p ~/.ssh
67+
ssh-keyscan github.com >> ~/.ssh/known_hosts
68+
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
69+
6370
- name: Build and push platform-specific image
6471
id: build
6572
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # @6.18.0

server/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ RUN cargo chef prepare --recipe-path recipe.json
99
FROM chef AS builder
1010
COPY --from=planner /app/recipe.json recipe.json
1111

12+
# Force cargo to use git CLI for SSH
13+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
14+
1215
# Build dependencies - this is the caching Docker layer
13-
RUN cargo chef cook --release --recipe-path recipe.json
16+
RUN --mount=type=ssh cargo chef cook --release --recipe-path recipe.json
1417

1518
# Build application
1619
COPY . .
17-
RUN cargo build --release --bin thirdweb-engine
20+
RUN --mount=type=ssh cargo build --release --bin thirdweb-engine
1821

1922
# Runtime stage
2023
FROM debian:bookworm-slim AS runtime

0 commit comments

Comments
 (0)