89luca89 / 89luca89/distrobox

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

Open
#2,065 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Go
Stars
13k
Forks
541
Avg merge
20h 47m
Merged PRs (30d)
4

Description

**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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.