NixOS/nix

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

開放

#11,217 建立於 2024年7月29日

 (3 則留言) (1 個反應) (0 位負責人)C++ (1,293 個分叉)batch import
bugerror-messagesfetchingflakesgood first issue

倉庫指標

星標
 (9,803 顆星)
PR 合併指標
 (平均合併 7天 11小時) (30 天內合併 83 個 PR)

描述

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.

貢獻者指南