89luca89 / 89luca89/distrobox

[Error] bash: -- : invalid option with archlinux image on nixos

Aberta
#2,065 4 comentários 1 reação 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Go
Estrelas
13k
Forks
541
Merge médio
20h 47min
PRs com merge (30d)
4

Descrição

**Describe the bug**

When entering an `--init` container (using systemd as PID 1), `distrobox enter` and `distrobox upgrade` both fail immediately with:

```
bash: -- : invalid option
Usage: bash [GNU long option] [option] ...
```

I fix that with

```
home.packages = [
(pkgs.distrobox.overrideAttrs (old: {
postInstall = (old.postInstall or "") + ''
substituteInPlace $out/bin/distrobox-enter \
--replace-fail 'set -- "--pty" "$@"' ':'
'';
}))
];
```

**To Reproduce**

1. Create an init container using Arch Linux:
```
distrobox create --init --image docker.io/archlinux:latest --name testinit
```
2. Try to enter it:
```
distrobox enter testinit
```

**Desktop**

- Container manager: **Docker**
- Docker version: `docker version` → 27.x
- Distrobox version: **1.8.2.4**
- Host distribution: **NixOS** (unstable)
- Distrobox installed via: **nixpkgs** (home-manager)
- Container image: `docker.io/archlinux:latest`

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

The bug is in distrobox-enter script where 'set -- "--pty" "$@"' fails on Arch Linux with systemd as PID 1. Look at the distrobox-enter script in the bin directory, understand how arguments are passed, and test the fix in a NixOS environment with an Arch Linux container. Verify by building the patched package and running the commands from the issue.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
bash, docker, nixos
Domínio
cli
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
55/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.