Skip to content
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

Dockerfiles do not build #326

Closed
julian-bcw opened this issue Jun 26, 2024 · 5 comments · Fixed by #329
Closed

Dockerfiles do not build #326

julian-bcw opened this issue Jun 26, 2024 · 5 comments · Fixed by #329
Assignees
Milestone

Comments

@julian-bcw
Copy link

Here are the commands I ran:

cd zero_bin
docker build -t worker -f worker.Dockerfile .

And here is the output:

[+] Building 1.7s (17/24)                                                                                                                                                               docker:orbstack
 => [internal] load build definition from worker.Dockerfile                                                                                                                                        0.0s
 => => transferring dockerfile: 1.06kB                                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye-slim                                                                                                                            0.7s
 => [internal] load metadata for docker.io/rustlang/rust:nightly-bullseye-slim                                                                                                                     1.5s
 => [internal] load .dockerignore                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                    0.0s
 => [internal] load build context                                                                                                                                                                  0.0s
 => => transferring context: 843B                                                                                                                                                                  0.0s
 => [stage-1 1/3] FROM docker.io/library/debian:bullseye-slim@sha256:acc5810124f0929ab44fc7913c0ad936b074cbd3eadf094ac120190862ba36c4                                                              0.0s
 => CACHED [stage-1 2/3] RUN apt-get update && apt-get install -y ca-certificates libjemalloc2                                                                                                     0.0s
 => CANCELED [builder  1/16] FROM docker.io/rustlang/rust:nightly-bullseye-slim@sha256:85b3f3a3f6df444134cd9037d3c3fba80957e3b29128e662ee2db36feb282865                                            0.1s
 => => resolve docker.io/rustlang/rust:nightly-bullseye-slim@sha256:85b3f3a3f6df444134cd9037d3c3fba80957e3b29128e662ee2db36feb282865                                                               0.0s
 => => sha256:85b3f3a3f6df444134cd9037d3c3fba80957e3b29128e662ee2db36feb282865 4.64kB / 4.64kB                                                                                                     0.0s
 => => sha256:b44f5fa13bc5c2468658b8f0dabaf4786a84550eb85ac2c1cea5d2095c37f70f 676B / 676B                                                                                                         0.0s
 => => sha256:fe50992711a8149839c6ae49ad4870fa17c721b83dce27e499b12de847c4a790 3.56kB / 3.56kB                                                                                                     0.0s
 => CACHED [builder  2/16] RUN apt-get update && apt-get install -y libjemalloc2 libjemalloc-dev make libssl-dev                                                                                   0.0s
 => CACHED [builder  3/16] RUN   mkdir -p common/src  && touch common/src/lib.rs &&   mkdir -p ops/src     && touch ops/src/lib.rs &&   mkdir -p worker/src  && echo "fn main() {println!("YO!");  0.0s
 => ERROR [builder  4/16] COPY Cargo.toml .                                                                                                                                                        0.0s
 => CACHED [builder  5/16] RUN sed -i "2s/.*/members = ["common", "ops", "worker"]/" Cargo.toml                                                                                                    0.0s
 => ERROR [builder  6/16] COPY Cargo.lock .                                                                                                                                                        0.0s
 => CACHED [builder  7/16] COPY common/Cargo.toml ./common/Cargo.toml                                                                                                                              0.0s
 => CACHED [builder  8/16] COPY ops/Cargo.toml ./ops/Cargo.toml                                                                                                                                    0.0s
 => CACHED [builder  9/16] COPY worker/Cargo.toml ./worker/Cargo.toml                                                                                                                              0.0s
 => ERROR [builder 10/16] COPY ./rust-toolchain.toml ./                                                                                                                                            0.0s
------
 > [builder  4/16] COPY Cargo.toml .:
------
------
 > [builder  6/16] COPY Cargo.lock .:
------
------
 > [builder 10/16] COPY ./rust-toolchain.toml ./:
------
worker.Dockerfile:18
--------------------
  16 |     COPY worker/Cargo.toml ./worker/Cargo.toml
  17 |
  18 | >>> COPY ./rust-toolchain.toml ./
  19 |
  20 |     RUN cargo build --release --bin worker
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 463c0b1e-3e12-4fd0-bf85-2907b847421c::is4bkoirrriv3bqqaor2iie76: "/rust-toolchain.toml": not found
@atanmarko atanmarko self-assigned this Jun 26, 2024
@BGluth
Copy link
Member

BGluth commented Jun 26, 2024

Right. This came from migrating zero_bin into this repo (zk_evm). We ended up removing rust-toolchain.toml from zero_bin just because there was already one in zk_evm. I think we can probably just remove this line?

@atanmarko
Copy link
Member

@BGluth I did a fix and a bit of refactor in #329 . Still debugging some strange issue with leader file (leader image) not being accessible correctly.

@atanmarko
Copy link
Member

Btw. would be nice to add docker build test to the CI

@Nashtare
Copy link
Collaborator

Btw. would be nice to add docker build test to the CI

100% agree.

@BGluth
Copy link
Member

BGluth commented Jun 26, 2024

Just an update. The issue was .env is not being copied over in the image, and (it should not be doing this) it's crashing early on when it can not find it. Really we need to be able to run the binary on it's own without .env being present, so this needs to be made optional imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants