Alpine linux is being used as a base for many docker images. Unfortunately I haven’t seen many posts or guides on how to setup alpine as a docker host. So let’s change that.
- Download Alpine Linux, burn as usual with
ddand boot it.
- Login as root, run
setup-alpineand breeze through it.
I installed in sys mode since I wanted the system to be written to the disk.
After rebooting you should have an Alpine linux installation. Onto my personal configuration.
//Create users group # addgroup users //Create user newuser in users group with ash as default shell # adduser -s /bin/ash -G users newuser //Install sudo # apk add sudo
I then edited the sudo file using
visudo and uncommented
%wheel ALL=(ALL) ALL .
Files to edit
After editing these files, I change to an SSH connection and use
ssh-copy-id to copy over a pubkey.
Adding the following lines to /etc/ssh/sshd_config once the key has been copied.
Another thing you might consider doing is using a firewall like ufw, awall or just configure the iptables (just remember Docker will probably ignore your settings because it writes to iptables directly).
Should install and setup docker according to the wiki.
After this you’ll be able to use docker via
sudo docker or just
docker if you add yourself to the
(The ArchWiki explains why maybe adding users to the
docker group is not a good idea.)
Personal Run Scripts
(This was written before
docker-compose was a thing, use that instead)