PullImage ignored opts.DryRun and pulled anyway.
Thread DryRun through PullImage and gate
the usesRunc / supportsKeepIDSize probes.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Wire signal.NotifyContext in main so SIGINT/SIGTERM cancel the context
instead of killing the process.
ephemeral and assemble now defer rm on a detached cleanup ctx, so the
in-flight container is removed even when the user hits Ctrl+C.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
`Interactive: !NoTTY` routed stdio to discarded buffers whenever
--no-tty was set, breaking ptyxis. --no-tty only governs whether
`--tty` is appended to the exec args, not stdio plumbing.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Previously, the CLI hardcoded "1.0.0" as the version string in two places (the root command and the generate-entry subcommand).
Introduce pkg/version, a minimal package that exposes a single variable Version, defaulting to "dev". The root command now references such a value; generate-entry does not need it al all
The Makefile computes the version at build time by running:
git describe --tags --always
This produces the exact tag name when HEAD is tagged, or --g when it is not, giving a precise description of the build relative to the nearest ancestor tag. If git is unavailable, the value falls back to "dev".
The resulting string is injected into the binary via:
-ldflags "-X github.com/89luca89/distrobox/pkg/version.Version=<value>" so that distrobox --version and distrobox generate-entry --version both report the exact version of the build.
Some flags are shared to many commands but not to all (example: `--root`). By composing decorators, each command can be configured so that is assigned only to the flags that matters.
CustomCommand was joined into a string and re-split on whitespace,
collapsing quoted args — `sh -c "echo a || echo b"` lost its script
body, and any value passed by upgrade/assemble with embedded spaces
or quotes got mangled. Pass argv through as []string end-to-end.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
* fix(create): handle root correctly
The `root` flag is handled in the root cli command. if we re-declare the
flag here we shadow it, resulting in a contaner manager initializated as
non-root.
Before this commit, these two commands produce respectively one root and
one non-root execution
```
distrobox --root create # root
distrobox create --root # non-root
```
* fix(generate-entry): handle root correctly
The `root` flag is handled in the root cli command. if we re-declare the
flag here we shadow it, resulting in a contaner manager initializated as
non-root.
Before this commit, these two commands produce respectively one root and
one non-root execution
```
distrobox --root generate-entry # root
distrobox generate-entry --root # non-root
```
* enter(next): fix unshare_groups su args and tty handling
* test(docker): fix noTTY semantics in buildCommandArgs cases
* cli(enter): fix no-tty help text
The current implementation uses dotenv to load the configuration into
the environment, and then delegate the cli layer to handle the
configuration coming from the DBX_ variables.
With this new implementation, defaults, config files and environment
variables are handled in a single point and treated as values.
* fix(containermanager): fix typos in ContanerID and ContanerManagerType
* fix(rm): pass ContainerHome to RmOptions when removing container
* fix(containermanager): handle empty names slice in podman container list
* fix(create): initialize prompter in NewCreateCommand to prevent nil dereference
* fix(userenv): trim trailing newline from uid and gid command output
* refactor(containermanager): move shared types and constants to providers common file
* fix(containermanager): skip /dev/shm volume mount if EvalSymlinks fails
* fix(containermanager): rename ContainerManagerType to ManagerType to avoid stutter
* restore: ManagerType -> ContainerManagerType
* test(containermanager): add empty names fallback test for parsePodmanContainerList
* fix(containermanager): suppress revive stutter lint for ContainerManagerType
* fix(containermanager): use empty string fallback when podman container has no name
* fix(commands): pass real prompter to create command in assemble and ephemeral
* Revert "refactor(containermanager): move shared types and constants to providers common file"
This reverts commit 59faeb71f8.
Since `install` and `uninstall` don't work on the new setup, we're just
stripping them for the moment.
Signed-off-by: Alessio Biancalana <alessio@dottorblaster.it>