Alpine Linux


Create Bootable Device

The Alpine Linux wiki recommends use of fdisk. For more general advice regarding partitioning, see here.

First and foremost, insert the device and ensure it is not mounted. (If it is, umount /dev/sdXN.) Secondly, ensure that the device is not using a GPT partition table. This would be listed by 'Disklabel type' in fdisk. The correct value is dos, not gpt.

Per the wiki:

fdisk /dev/sdX

mkfs.vfat /dev/sdX1

Note that mkfs.vfat and mkdosfs are the same.

Finally, dd the ISO onto the device. Or for a Raspberry Pi, copy the boot binaries onto the device.


Maintenance

Alpine does best when you do the least with it. In general you will not be installing many packages or configuring the system away from the base image.

Alpine's package manager is apk. To add a package, run apk update && apk add python3.

Alpine is by default a read-only operating system. To make a change persist, the change must actually be committed to the overlay files. This is done by running lbu commit -d.


Docker Setup

Alpine was designed to urn Docker. To install Docker (and its ecosystem), run:

apk add docker
apk add docker-compose

If this fails because of 'unsatisfiable constraints', the mirrors file must be edited. Uncomment the community repository in `/etc/apk/repositories'.

Docker can be run manually with service docker start or set to run at boot with rc-update add docker boot.


CategoryRicottone