Size: 3120
Comment:
|
Size: 3164
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was renamed from Linux/AlpineLinux |
Alpine Linux
Alpine Linux comes from the team behind Docker, with the intention of achieving a more minimal system.
Installation
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:
Run fdisk on your device (sdX).
fdisk /dev/sdX
- Create new partition table with one FAT32 partition
d Delete all partitions (this may take a few steps)
n Create a new partition
p A primary partition
1 Partition number 1
- Use defaults for first and last cylinder (just press [Enter] twice).
t Change partition type
c Partition type (Win95 FAT32/LBA)
- Verify that the primary partition is bootable
p Print list of partitions
- If there is no '*' next to the first partition, follow the next steps:
a Make the partition bootable (set boot flag)
1 Partition number 1
w Write your changes to the device
- Format the new partition with:
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.
Administration
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.
Software Installation
Alpine's package manager is apk. To update installed packages, run apk update && apk upgrade. To add a package like Docker, run apk update && apk add docker.
The package manager looks to /etc/apk/repositories for mirrors. Notably, the community mirror is commented-out by default. Uncomment that line to install software such as Docker.
Services
Alpine uses the OpenRC init system, which is designed to be very similar but simpler than the traditional SysV init system.
To start a service like Docker, try:
service SERVICE start service SERVICE status
To start a service automatically at boot, try:
rc-update add SERVICE default rc-status
Use the default runlevel for user services. The other runlevels (boot, single, reboot, and shutdown) should be reserved for the operating system processes.
Storage
Alpine is a read-only operating system. To make a change persist, the change must actually be committed to the boot overlay files. This is done by running lbu commit -d.
Persistent storage can be mounted through normal processes.