From 0f2df6d352f69caaddd372603d9ab6354deb9926 Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 24 Feb 2024 10:44:52 +0800 Subject: [PATCH] chore: fix docker build --- .github/workflows/push_latest_docker.yml | 2 +- Dockerfile | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push_latest_docker.yml b/.github/workflows/push_latest_docker.yml index ba7d0a57..32d3b458 100644 --- a/.github/workflows/push_latest_docker.yml +++ b/.github/workflows/push_latest_docker.yml @@ -91,7 +91,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} provenance: false build-args: | - FEATURES="disable_access_control" + FEATURES=disable_access_control - name: Logout from Docker Hub if: always() diff --git a/Dockerfile b/Dockerfile index c3c9cfd4..7dd4de4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ FROM lukemathwalker/cargo-chef:latest-rust-1.75.0 as chef -# Build argument for features -ARG FEATURES="" - WORKDIR /app RUN apt update && apt install lld clang -y @@ -12,6 +9,10 @@ COPY . . RUN cargo chef prepare --recipe-path recipe.json FROM chef as builder + +# Specify a default value for FEATURES; it could be an empty string if no features are enabled by default +ARG FEATURES="" + COPY --from=planner /app/recipe.json recipe.json # Build our project dependencies RUN cargo chef cook --release --recipe-path recipe.json @@ -20,7 +21,7 @@ ENV SQLX_OFFLINE true # Build the project RUN echo "Building with features: ${FEATURES}" -RUN cargo build --profile=profiling --features=${FEATURES} --bin appflowy_cloud +RUN cargo build --profile=profiling --features "${FEATURES}" --bin appflowy_cloud FROM debian:bookworm-slim AS runtime