greyltc / docker-archlinux

Baseline Arch Linux Docker image
GNU General Public License v2.0
49 stars 6 forks source link

Tips on how to use dockerized Arch #4

Closed almson closed 7 years ago

almson commented 7 years ago

I'm a bit lost on where to start. On Ubuntu, I could start sshd with service ssh start. However, on Arch systemctl complains of missing dbus. Any tips on how to launch services and do more?

greyltc commented 7 years ago

Yeah, I've built this container without systemd (I don't think it's needed in containers). What I typically do if I need a thing that systemd generally starts is I inspect the systemd config file for that thing, then I do it manually.

Here's probably a very relevant example for you that's just my archlinux container with sshd :

https://github.com/greyltc/docker-sshd https://hub.docker.com/r/greyltc/sshd/

almson commented 7 years ago

Thanks, looking at systemd config files is the way to go. Another trick that I couldn't find anywhere is to use dbus-launch. For example, to set up NoMachine to launch Xfce, set DefaultDesktopCommand "/usr/bin/dbus-launch /usr/bin/startxfce4" in /usr/NX/etc/node.cfg. (In Ubuntu, this wasn't necessary.)

P.S. The creation of ssh host keys should probably be in the startup script, not in the container image. And of course, no blank-root-password-login nonsense. What I do is to map a volume into the user's home with authorized_keys (so each docker-compose service can have its own keys).