eth-educators/eth-docker

`ethd config` fails on macOS with `/var/lib/docker` error message

alindsilva opened this issue · 5 comments

While trying to run ./ethd config on a MAC configured with docker desktop, I run into the following error message regarding /var/lib/docker not existing on the host device.

+] Building 25.4s (60/68) docker:desktop-linux
=> [execution internal] load build definition from Dockerfile.binary 0.0s
=> => transferring dockerfile: 1.37kB 0.0s
=> [consensus internal] load build definition from Dockerfile.binary 0.0s
=> => transferring dockerfile: 1.89kB 0.0s
=> [execution internal] load metadata for docker.io/nethermind/nethermin 0.3s
=> [mev-boost internal] load build definition from Dockerfile.binary 0.0s
=> => transferring dockerfile: 416B 0.0s
=> [validator internal] load metadata for docker.io/sigp/lighthouse:late 0.5s
=> [mev-boost internal] load metadata for docker.io/flashbots/mev-boost: 0.3s
=> [execution internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [consensus internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [consensus internal] load build context 0.0s
=> => transferring context: 6.13kB 0.0s
=> [validator 1/11] FROM docker.io/sigp/lighthouse:latest-modern@sha256 0.0s
=> [execution 1/8] FROM docker.io/nethermind/nethermind:latest@sha256:66 0.0s
=> [execution internal] load build context 0.0s
=> => transferring context: 3.71kB 0.0s
=> [mev-boost internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [execution 2/8] RUN addgroup --gid "10002" "nethermind 0.0s
=> CACHED [execution 3/8] RUN adduser --disabled-password --geco 0.0s
=> CACHED [execution 4/8] RUN set -eux; apt-get update; DEBIAN_FRONTEN 0.0s
=> CACHED [execution 5/8] RUN chown -R nethermind:nethermind /nethermind 0.0s
=> CACHED [execution 6/8] RUN mkdir -p /var/lib/nethermind/ee-secret && 0.0s
=> CACHED [execution 7/8] COPY --chown=nethermind:nethermind ./docker-en 0.0s
=> CACHED [execution 8/8] RUN chmod -R 755 /usr/local/bin/* 0.0s
=> CACHED [validator-exit 2/11] RUN adduser --disabled-password 0.0s
=> CACHED [validator-exit 3/11] RUN mkdir -p /var/lib/lighthouse/beacon 0.0s
=> CACHED [consensus 4/11] COPY --chown=lhconsensus:lhconsensus ./docke 0.0s
=> CACHED [consensus 5/11] RUN chmod -R 755 /usr/local/bin/* 0.0s
=> CACHED [consensus 6/11] RUN adduser --disabled-password --ge 0.0s
=> CACHED [consensus 7/11] RUN mkdir -p /var/lib/lighthouse/validators 0.0s
=> CACHED [consensus 8/11] RUN set -eux; apt-get update; 0.0s
=> CACHED [consensus 9/11] COPY --chown=lhvalidator:lhvalidator ./valid 0.0s
=> CACHED [consensus 10/11] COPY --chown=lhvalidator:lhvalidator ./docke 0.0s
=> CACHED [consensus 11/11] RUN chmod -R 755 /usr/local/bin/* 0.0s
=> [consensus] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:db02066ad166d171caa29926222a6420085282106db8d 0.0s
=> => naming to docker.io/library/lighthouse:local 0.0s
=> [execution] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:2074ad2ea7eff11e7ba1f228f708649c45baf3fc29dd6 0.0s
=> => naming to docker.io/library/nethermind:local 0.0s
=> [mev-boost 1/2] FROM docker.io/flashbots/mev-boost:latest@sha256:681a 0.0s
=> CACHED [mev-boost 2/2] RUN adduser --disabled-password --geco 0.0s
=> [mev-boost] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:542fbfaf7e04a5152cec8f32a2503e7333b237a61b17b 0.0s
=> => naming to docker.io/library/mev-boost:local 0.0s
=> [validator internal] load build definition from Dockerfile.binary 0.0s
=> => transferring dockerfile: 1.89kB 0.0s
=> [validator-exit internal] load build definition from Dockerfile.binar 0.1s
=> => transferring dockerfile: 1.89kB 0.0s
=> [validator internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [validator-exit internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [validator-exit internal] load build context 0.0s
=> => transferring context: 122B 0.0s
=> [validator internal] load build context 0.0s
=> => transferring context: 6.13kB 0.0s
=> CACHED [validator-exit 4/11] COPY --chown=lhconsensus:lhconsensus ./ 0.0s
=> CACHED [validator-exit 5/11] RUN chmod -R 755 /usr/local/bin/* 0.0s
=> CACHED [validator-exit 6/11] RUN adduser --disabled-password 0.0s
=> CACHED [validator-exit 7/11] RUN mkdir -p /var/lib/lighthouse/valida 0.0s
=> CACHED [validator-exit 8/11] RUN set -eux; apt-get update; 0.0s
=> CACHED [validator-exit 9/11] COPY --chown=lhvalidator:lhvalidator ./ 0.0s
=> CACHED [validator-exit 10/11] COPY --chown=lhvalidator:lhvalidator ./ 0.0s
=> CACHED [validator-exit 11/11] RUN chmod -R 755 /usr/local/bin/* 0.0s
=> [validator-exit] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:198ac8049050ae27407fcd32ba68663a4795e4381b453 0.0s
=> => naming to docker.io/library/lighthouse:local 0.0s
=> [validator] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:014a78112e61b5d4b9f0b9320dee7746ed3e9472f21c2 0.0s
=> => naming to docker.io/library/lighthouse:local 0.0s
=> [validator-keys internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 262B 0.0s
=> [validator-keys internal] load metadata for docker.io/library/debian: 0.5s
=> [validator-keys internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [validator-keys 1/4] FROM docker.io/library/debian:bookworm-slim@sha2 3.8s
=> => resolve docker.io/library/debian:bookworm-slim@sha256:7802002798b0 0.0s
=> => sha256:7802002798b0e351323ed2357ae6dc5a8c4d0a05a57 1.85kB / 1.85kB 0.0s
=> => sha256:36a9d3bcaaec706e27b973bb303018002633fd3be7c2ac3 529B / 529B 0.0s
=> => sha256:b8ae8a9ddcccdb6e1165612aa92368b1aa1a08d4b84 1.46kB / 1.46kB 0.0s
=> => sha256:c57ee5000d61345aa3ee6684794a8110328e2274d 29.15MB / 29.15MB 0.5s
=> => extracting sha256:c57ee5000d61345aa3ee6684794a8110328e2274d9a5ae78 3.2s
=> [validator-keys internal] load build context 0.0s
=> => transferring context: 49.38kB 0.0s
=> [validator-keys 2/4] RUN apt-get update && DEBIAN_FRONTEND=nonintera 18.1s
=> [validator-keys 3/4] COPY --chown=1000:1000 ./keymanager.sh /usr/loca 0.4s
=> [validator-keys 4/4] RUN chmod -R 755 /usr/local/bin/* 0.4s
=> [validator-keys] exporting to image 0.5s
=> => exporting layers 0.5s
=> => writing image sha256:8163d4c1397dfd689a4e542253641d28a51f2a2df2f06 0.0s
=> => naming to docker.io/library/vc-utils:local 0.0s
df: /var/lib/docker: No such file or directory

./ethd terminated with exit code 1 on line 370
This happened during ./ethd config

Any suggestions on how to address this?

Try a git pull and see whether that resolves it.

This is a fairly brute-force workaround. If you can see where in macOS the Docker files (volumes) are, and how to know where they are, that'll be helpful. I am doing docker system info --format '{{.DockerRootDir}}' but because ethd is running on macOS while Docker is running inside a VM, this is not pointing me at the location inside macOS where this can be found.

Do me a solid if you would. After a git pull to get the latest, try ./ethd space and ./ethd update. Both should work, now, even on macOS. I added a workaround to find space available to Docker on macOS.

Thanks, Yorick for the guidance and assistance. Here is the output from the ./ethd spcae and ./ethd update commands.

./ethd space

You have 864 GiB free for Docker volumes

Here's total and used space on Docker's virtual volume
Filesystem Size Used Available Use% Mounted on
/dev/vda1 916.2G 4.9G 864.7G 1% /dummy

There are no Docker volumes for this copy of Eth Docker

If there is some mystery space being taken up, try "sudo ncdu /".

./ethd update
From https://github.com/eth-educators/eth-docker

  • branch main -> FETCH_HEAD
    Already up to date.
    Migrating .env to version 8

Please make requested changes manually or run "./ethd update" again
before running "./ethd up".

Without a FEE_RECIPIENT set in ".env", containers will not
start successfully. Already running containers will keep running with the
old configuration until you are ready to restart them.

I think we're seeing these messages because I have fully stepped through the configuration of eth-docker given the earlier issues.

Btw, I am going to send you a pull request on another 'issue' that I found in ethd (line 3502) where the command to figure out if ethd was running as root uses the stat command incorrectly. I had to change it to read as follows ...

if [[ "$OSTYPE" == "darwin"* ]]; then

This is a macOS-ism

shellcheck disable=SC2016

OWNER=$(stat --format=%U .)
else
OWNER=$(stat --format=%U .)
fi

Re stat --format=%U ., that must have changed in macOS at some point. It's also possible this changed because I am now requiring bash 5 to be installed on macOS

Thanks for reporting this. I made the change.

One last comment while closing: The 1TB of space Docker Desktop assigned to itself by default won't be enough to run a mainnet node. It'll be more than sufficient for testnet.