diff --git a/.dockerignore b/.dockerignore index 93a8f1ce27..2c7d1472f4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,3 +5,4 @@ target/ .vscode/ .devcontainer/ .cargo/ +artifacts/ diff --git a/.github/Dockerfile b/.github/Dockerfile index dc80252e70..802cdbf052 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,16 +1,16 @@ -FROM rust:1.80.0-slim as chef +FROM rust:slim as chef # Install libclang and other necessary tools RUN apt-get update && \ - apt-get install -y clang llvm-dev libclang-dev git libtool automake autoconf make curl - -RUN apt-get install -y protobuf-compiler + apt-get install -y clang llvm-dev libclang-dev git libtool automake autoconf make curl protobuf-compiler && \ + rm -rf /var/lib/apt/lists/* # Verify and set LIBCLANG_PATH environment variable RUN find /usr -name "libclang.so*" && \ export LIBCLANG_PATH=$(find /usr -name "libclang.so*" | head -n 1 | xargs dirname) -RUN rustup install 1.79.0 +COPY rust-toolchain.toml . +RUN rustup install $(cat rust-toolchain.toml | grep channel | cut -d' ' -f3 | tr -d '"') RUN rustup component add cargo clippy rust-docs rust-std rustc rustfmt RUN cargo install cargo-chef @@ -27,7 +27,7 @@ WORKDIR /app COPY --from=planner /app/recipe.json recipe.json # Build dependencies - this is the caching Docker layer! RUN cargo chef cook --release --recipe-path recipe.json -RUN cargo build --release --bins +RUN cargo build --release --bins # pre-cache some stuff # Build application COPY . . diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 126af25da1..38779f8c72 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -43,7 +43,7 @@ jobs: - name: Build binaries run: | docker build -t build -f .github/Dockerfile . - docker run --rm -v $(pwd)/artifacts:/artifacts build /bin/sh -c "cp -r /app/artifacts/* /artifacts" + docker run --rm -v "$(pwd)/artifacts:/artifacts" build /bin/sh -c "cp -r /app/artifacts/* /artifacts" - name: Build and push docker image uses: docker/build-push-action@v3 diff --git a/.gitignore b/.gitignore index cf16ca3022..75b10b8482 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ justfile spawn-and-move-db types-test-db examples/spawn-and-move/manifests/saya/** + +artifacts/