Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions deploy/docker/Dockerfile.cli-macos
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ FROM ${OSXCROSS_IMAGE} AS osxcross

FROM python:3.12-slim AS builder

ARG OPENSHELL_CARGO_VERSION
ARG OPENSHELL_IMAGE_TAG
ARG CARGO_TARGET_CACHE_SCOPE=default

ENV PATH="/root/.cargo/bin:/usr/local/bin:/osxcross/bin:${PATH}"
Expand Down Expand Up @@ -105,6 +103,9 @@ RUN touch crates/openshell-cli/src/main.rs \
crates/openshell-core/build.rs \
proto/*.proto

# Declare version ARG here (not earlier) so the git-hash-bearing value does not
# invalidate the expensive dependency-build layers above on every commit.
ARG OPENSHELL_CARGO_VERSION
RUN --mount=type=cache,id=cargo-registry-cli-macos,sharing=locked,target=/root/.cargo/registry \
--mount=type=cache,id=cargo-git-cli-macos,sharing=locked,target=/root/.cargo/git \
--mount=type=cache,id=cargo-target-cli-macos-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \
Expand Down
4 changes: 3 additions & 1 deletion deploy/docker/Dockerfile.cluster
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certifi
FROM --platform=$BUILDPLATFORM rust:1.88-slim AS supervisor-builder
ARG TARGETARCH
ARG BUILDARCH
ARG OPENSHELL_CARGO_VERSION
ARG CARGO_TARGET_CACHE_SCOPE=default
ARG SCCACHE_MEMCACHED_ENDPOINT

Expand Down Expand Up @@ -132,6 +131,9 @@ RUN touch crates/openshell-sandbox/src/main.rs \
proto/*.proto

# Build the supervisor binary
# Declare version ARG here (not earlier) so the git-hash-bearing value does not
# invalidate the expensive dependency-build layers above on every commit.
ARG OPENSHELL_CARGO_VERSION
RUN --mount=type=cache,id=cargo-registry-supervisor-${TARGETARCH},sharing=locked,target=/usr/local/cargo/registry \
--mount=type=cache,id=cargo-target-supervisor-${TARGETARCH}-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \
--mount=type=cache,id=sccache-supervisor-${TARGETARCH},sharing=locked,target=/tmp/sccache \
Expand Down
4 changes: 3 additions & 1 deletion deploy/docker/Dockerfile.gateway
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
FROM --platform=$BUILDPLATFORM rust:1.88-slim AS builder
ARG TARGETARCH
ARG BUILDARCH
ARG OPENSHELL_CARGO_VERSION
ARG CARGO_TARGET_CACHE_SCOPE=default

# Install build dependencies
Expand Down Expand Up @@ -68,6 +67,9 @@ RUN touch crates/openshell-server/src/main.rs \
proto/*.proto

# Build the actual application
# Declare version ARG here (not earlier) so the git-hash-bearing value does not
# invalidate the expensive dependency-build layers above on every commit.
ARG OPENSHELL_CARGO_VERSION
RUN --mount=type=cache,id=cargo-registry-gateway-${TARGETARCH},sharing=locked,target=/usr/local/cargo/registry \
--mount=type=cache,id=cargo-target-gateway-${TARGETARCH}-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \
--mount=type=cache,id=sccache-gateway-${TARGETARCH},sharing=locked,target=/tmp/sccache \
Expand Down
5 changes: 3 additions & 2 deletions deploy/docker/Dockerfile.python-wheels
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ FROM base AS builder

ARG TARGETARCH
ARG BUILDARCH
ARG OPENSHELL_CARGO_VERSION
ARG OPENSHELL_IMAGE_TAG
ARG CARGO_TARGET_CACHE_SCOPE=default

ARG SCCACHE_MEMCACHED_ENDPOINT
Expand Down Expand Up @@ -86,6 +84,9 @@ RUN touch crates/openshell-cli/src/main.rs \
crates/openshell-core/build.rs \
proto/*.proto

# Declare version ARG here (not earlier) so the git-hash-bearing value does not
# invalidate the expensive dependency-build layers above on every commit.
ARG OPENSHELL_CARGO_VERSION
RUN --mount=type=cache,id=cargo-registry-python-wheels-${TARGETARCH},sharing=locked,target=/root/.cargo/registry \
--mount=type=cache,id=cargo-git-python-wheels-${TARGETARCH},sharing=locked,target=/root/.cargo/git \
--mount=type=cache,id=cargo-target-python-wheels-${TARGETARCH}-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \
Expand Down
5 changes: 3 additions & 2 deletions deploy/docker/Dockerfile.python-wheels-macos
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ FROM ${OSXCROSS_IMAGE} AS osxcross
FROM python:${PYTHON_VERSION}-slim AS builder

ARG TARGETARCH
ARG OPENSHELL_CARGO_VERSION
ARG OPENSHELL_IMAGE_TAG
ARG CARGO_TARGET_CACHE_SCOPE=default

ENV PATH="/root/.cargo/bin:/usr/local/bin:/osxcross/bin:${PATH}"
Expand Down Expand Up @@ -93,6 +91,9 @@ RUN touch crates/openshell-cli/src/main.rs \
crates/openshell-core/build.rs \
proto/*.proto

# Declare version ARG here (not earlier) so the git-hash-bearing value does not
# invalidate the expensive dependency-build layers above on every commit.
ARG OPENSHELL_CARGO_VERSION
RUN --mount=type=cache,id=cargo-registry-python-wheels-macos-${TARGETARCH},sharing=locked,target=/root/.cargo/registry \
--mount=type=cache,id=cargo-git-python-wheels-macos-${TARGETARCH},sharing=locked,target=/root/.cargo/git \
--mount=type=cache,id=cargo-target-python-wheels-macos-${TARGETARCH}-${CARGO_TARGET_CACHE_SCOPE},sharing=locked,target=/build/target \
Expand Down
Loading