NixOS/nix

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

Open

#11,217 创建于 2024年7月29日

在 GitHub 查看
 (3 评论) (1 反应) (0 负责人)C++ (9,803 star) (1,293 fork)batch import
bugerror-messagesfetchingflakesgood first issue

描述

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 :+1: to issues you find important.

贡献者指南