Recipes

ERROR: mount options is too long

You are probably reading this because you encountered an error that looks like this when building a recipe:

ERROR: mount options is too long------ > mkfile /usr/lib/devzero/build-scripts/....: ------ 
error: failed to solve: mount options is too long Build failed with code 1

This is happening because the container image that's getting created for your recipe has too many layers, i.e., too many build-steps. You can fix it by combining a few build steps together and overall, reducing the number of explicit build steps in your recipe.

Our general guideline is to keep this under 100 steps.

To learn more about why something like this happens, check this out. This limitation is due to how Linux handles syscalls, and various container registries also impose this limit.

How to enable Docker in a workspace...

You are probably reading this because you encountered the following error when trying to execute a docker related error:

$ docker run hello-world
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

$ docker ps
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json": dial unix /var/run/docker.sock: connect: permission denied

To get Docker working in your workspace, add the following command to your recipe:

- command: |-
      sudo groupadd docker || true
      sudo usermod -aG docker $USER
      newgrp docker # if you can't access docker, try rebooting the workspace once: `sudo reboot`
      sudo chown "$USER":"$USER" "$HOME"/.docker -R
      sudo chmod g+rwx "$HOME/.docker" -R
      sudo systemctl start docker
      sudo systemctl enable docker.service
      sudo systemctl enable containerd.service
    name: run_at_startup_script

In order for this to work, please be sure the command name starts with run_at_startup_.

Need help? Reach out to support@devzero.io

Last updated