-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependancy builds not caching #180
Comments
It's impossible for me to help you with this little information. As far as I can see, the Dockerfile is using |
Hi, I'm running into the same issue. We're using Kaniko on GitLab and the RUN cargo chef cook --release --recipe-path recipe.json step is replayed with each build whereas it works perfectly locally. @LukeMathWalker I deeply think the issue comes from Kaniko rather than cargo-chef. What kind of information you might need to help us debug this? |
I just had a similar problem, and it was because the CI system was "helpfully" caching the |
I'm seeing a similar problem when trying to build sqld. Dockerfile for reference: # install dependencies
FROM rust:slim-bullseye AS compiler
RUN apt update \
&& apt install -y libclang-dev clang \
build-essential tcl protobuf-compiler file \
libssl-dev pkg-config \
&& apt clean
RUN cargo install cargo-chef
WORKDIR /sqld
# prepare recipe
FROM compiler AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
# build sqld
FROM compiler AS builder
COPY --from=planner sqld/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build -p sqld --release
# runtime
FROM debian:bullseye-slim
COPY --from=builder /sqld/target/release/sqld /bin/sqld
RUN adduser --system --home /var/lib/sqld --uid 666 sqld
RUN apt-get update && apt-get install -y ca-certificates
COPY docker-entrypoint.sh /usr/local/bin
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
VOLUME [ "/var/lib/sqld" ]
WORKDIR /var/lib/sqld
USER sqld
EXPOSE 5001 5432 8080
CMD ["/bin/sqld"] I think I managed to track down what causes it. If I run (outside of Docker): cargo clean
cargo chef cook --release --recipe-path recipe.json
cargo build -p sqld --release I can see that But, as warned, And if I do: cargo clean
cargo chef cook --release --recipe-path recipe.json
git checkout .
cargo build -p sqld --release Then The thing is that doing Is there a way to run |
I think you might be hitting #231
with:
If it helps then it's #231 It solved the problem for me in sqld @athoscouto mentioned above. See libsql/sqld#549 for more details. |
Closing this since #231 has been merged. |
Hi all,
I'm trying to use cargo-chef to speed up my google cloud run build times. The first stage of my docker file is hitting the cache, but the stage the builds the dependencies isn't. Any help would be really appreciated!
when I run gcloud config list
gcloud build command:
The text was updated successfully, but these errors were encountered: