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

File '/dev/full' has an unsupported type in / in Docker #11217

Open
mausch opened this issue Jul 29, 2024 · 2 comments
Open

File '/dev/full' has an unsupported type in / in Docker #11217

mausch opened this issue Jul 29, 2024 · 2 comments
Labels
bug error-messages Confusing messages and better diagnostics fetching Networking with the outside (non-Nix) world, input locking flakes good first issue Quick win for first-time contributors

Comments

@mausch
Copy link
Member

mausch commented Jul 29, 2024

Describe the bug

Given this dockerfile:

FROM ubuntu:24.04

RUN apt update -y && apt install curl -y
RUN curl -sSf -L https://github.com/DeterminateSystems/nix-installer/releases/download/v0.20.2/nix-installer-x86_64-linux -o nix-installer
RUN chmod +x nix-installer
RUN ./nix-installer install linux \
  --extra-conf "sandbox = false" \
  --init none \
  --no-confirm
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"

# WORKDIR /workdir

COPY flake.nix .

RUN nix run

and a trivial flake.nix:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  };

  outputs = { self, nixpkgs }: {

    packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;

    packages.x86_64-linux.default = self.packages.x86_64-linux.hello;

  };
}

Building the docker image crashes at the nix run step with:

#11 [7/7] RUN nix run
#11 0.174 error:
#11 0.174        … while fetching the input 'path:/'
#11 0.174 
#11 0.174        error: file '/dev/full' has an unsupported type
#11 ERROR: process "/bin/sh -c nix run" did not complete successfully: exit code: 1

Setting a WORKDIR fixes this. Problem is the error message is pretty obscure.

Expected behavior

A less obscure error message.

nix-env --version output

nix-env (Nix) 2.23.3

Priorities

Add 👍 to issues you find important.

@mausch mausch added the bug label Jul 29, 2024
@roberth
Copy link
Member

roberth commented Jul 31, 2024

while fetching the input 'path:/'

Nix should probably reject fetching /, although with #6530 this might actually work?

I'd recommend putting your files in at least something like /src

@roberth roberth added fetching Networking with the outside (non-Nix) world, input locking flakes labels Jul 31, 2024
@mausch
Copy link
Member Author

mausch commented Jul 31, 2024

I'd recommend putting your files in at least something like /src

Yep I'm aware of how to avoid this. The issue is specifically about the error message.

@roberth roberth added error-messages Confusing messages and better diagnostics good first issue Quick win for first-time contributors labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug error-messages Confusing messages and better diagnostics fetching Networking with the outside (non-Nix) world, input locking flakes good first issue Quick win for first-time contributors
Projects
None yet
Development

No branches or pull requests

2 participants