Install Alpine on LXC
LXC is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel.
With LXC you can run Alpine Linux on container and start services in it using native Alpine Linux' init system (openrc).
This is instruction on how to install Alpine Linux on LXC container.
You have to install "lxc" package on your host system. For example, in Arch Linux you can install it by running:
You also have to create network bridge on your host.
Here is example, how to setup bridge with netctl:
Copy sample file "bridge"
Modify your bridge configuration file as needed (network interfaces: eno1 and tap0 are, of cource, according to your needs)
Description="Bridge connection" Interface=br0 Connection=bridge BindsToInterfaces=(eno1 tap0) IP=dhcp
Stop active connection
Start your bridge
Perhaps you may wish to setup your system to start your bridge automatically at boot time.
To install Alpine Linux edge version run:
You can also configure shared directory which will be accessible from both host and container. In this example we make host's /media/d directory available in container
Modify container's configuration file:
Add folowing lines:
lxc.network.type = veth lxc.network.flags = up lxc.network.link = br0 lxc.mount.entry=/media/d media/d none bind 0 0
Shutting down container:
Going to Alpine Linux console:
Modify your apk/repositories configuration file
It is recommended to include "main", "testing" and "community" repositories.
http://nl.alpinelinux.org/alpine/edge/main http://nl.alpinelinux.org/alpine/edge/testing http://nl.alpinelinux.org/alpine/edge/community
Upgrading your Alpine Linux system:
Adding services to autostart
Restarting your container: