Skip to content

Commit

Permalink
[Dockerfile][Experimental] Remove cargo-chef and sequence builds (#6841)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalajiarun authored Mar 3, 2023
1 parent eafa8d2 commit 08334bc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
21 changes: 0 additions & 21 deletions docker/experimental/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
binutils \
lld

# install cargo chef to cache dependencies
RUN --mount=type=cache,target=/root/.cargo <<EOT
cargo install [email protected]
cargo install cargo-cache --no-default-features --features ci-autoclean
EOT

### Build Rust dependencies ###
FROM rust-base as planner

COPY --link . .
RUN cargo chef prepare --recipe-path recipe.json

### Build Rust code ###
FROM rust-base as builder-base

Expand All @@ -52,15 +40,6 @@ RUN ARCHITECTURE=$(uname -m | sed -e "s/arm64/arm_64/g" | sed -e "s/aarch64/aarc
&& chmod +x "/usr/local/bin/protoc" \
&& rm "protoc-21.5-linux-$ARCHITECTURE.zip"

# Use cargo chef
COPY --link --from=planner /aptos/recipe.json recipe.json

# Build dependencies - this is the caching Docker layer!
RUN <<EOT
cargo chef cook --profile ${PROFILE} --workspace --recipe-path recipe.json
cargo cache
EOT

COPY --link . /aptos/

FROM builder-base as aptos-node-builder
Expand Down
3 changes: 1 addition & 2 deletions docker/experimental/debian-base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ FROM debian AS debian-base
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache

# Add Tini to make sure the binaries receive proper SIGTERM signals when Docker is shut down
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini /tini
RUN chmod +x /tini
ADD --chmod=755 https://github.com/krallin/tini/releases/download/v0.19.0/tini /tini
ENTRYPOINT ["/tini", "--"]
3 changes: 0 additions & 3 deletions docker/experimental/docker-bake-rust-all.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ group "forge-images" {

target "debian-base" {
dockerfile = "docker/experimental/debian-base.Dockerfile"
context = "."
contexts = {
debian = "docker-image://debian:bullseye-20220912@sha256:3e82b1af33607aebaeb3641b75d6e80fd28d36e17993ef13708e9493e30e8ff9"
}
Expand All @@ -81,7 +80,6 @@ target "builder-base" {
target "aptos-node-builder" {
dockerfile = "docker/experimental/builder.Dockerfile"
target = "aptos-node-builder"
context = "."
contexts = {
rust = "docker-image://rust:1.64.0-bullseye@sha256:5cf09a76cb9baf4990d121221bbad64927cc5690ee54f246487e302ddc2ba300"
builder-base = "target:builder-base"
Expand All @@ -100,7 +98,6 @@ target "aptos-node-builder" {
target "tools-builder" {
dockerfile = "docker/experimental/builder.Dockerfile"
target = "tools-builder"
context = "."
contexts = {
rust = "docker-image://rust:1.64.0-bullseye@sha256:5cf09a76cb9baf4990d121221bbad64927cc5690ee54f246487e302ddc2ba300"
builder-base = "target:builder-base"
Expand Down

0 comments on commit 08334bc

Please sign in to comment.