4 ms·
> Redhat made Podman which is a compatible replacement I would actually prefer if they made an incompatible replacement. Docker's CLI is pretty bad in my opini
by young_unixer 6y ago
> Redhat made Podman which is a compatible replacement
I would actually prefer if they made an incompatible replacement. Docker's CLI is pretty bad in my opinion.
I want to use Docker the same way I use a headless virtual machine running an SSH server. I want starting/exiting containers to be independent from their 'main process'. I want to attach/detach whenever I need to and execute arbitrary processes.
-- Just use /bin/bash as the main process
This seems to be the workaround, but I always have problems with containers exiting when I don't want them to and it's just harder than what it needs to be. I've spent a total of like 6 hours learning Docker and I still don't know exactly how to achieve this simple workflow without my containers quitting on me or attach/detach issues. With VirtualBox I can do this easily. Am I too stupid to use Docker?
-- Then just use VirtualBox
That's what I do, but I would like not to have the overhead of a vm.
- krferriter 6y agoThey made podman as a fully compatible replacement so people could easily drop-in replace their use of docker with podman, which worked. To handle spurious interrupts from /bin/bash you can put a small script as the entrypoint containing a while true loop with a sleep infinity in it.
- IceWreck 6y agohave you looked at toolbox? Its by Red Hat and works with podman under the hood
- sjy 6y ago> I want to use Docker the same way I use a headless virtual machine running an SSH server. I want starting/exiting containers to be independent from their 'main process'. If you’re running systemd anyway, check out systemd-nspawn. Your ssh command becomes `machinectl shell user@container`. It’s a more VM-like way of managing containers, without Docker’s image distribution features or philosophy that containers should be ephemeral.
- cpuguy83 6y agoThere is a key sequence for detaching from the container... default is ctrl-p+q. But if you want to not deal with attach/detach, perhaps `docker exec` is what you want. It doesn't affect the main process (unless of course your command you run kills the main process).
- viraptor 6y ago> I want to attach/detach whenever I need to and execute arbitrary processes. Isn't "docker exec -ti container-id /arbitrary/command" enough for that?
- ed25519FUUU 6y agoAnd if you want a shell? Just use “bash” as the command.
- lathiat 6y agoSounds like you might want LXD which starts and leaves running a full "machine" container. You can even SSH to it if you want or just use "lxc shell bionic" to get into it. https://linuxcontainers.org/lxd/getting-started-cli/ https://linuxcontainers.org/lxd/getting-started-cli/