Install Alpine Linux In A Virtual Machine

Alpine Linux is super lightweight and its easy for developer who use Docker to generate their own images using alpine as base. but for me i wanted to run some stuff via cron and for which i was not interested to install Ubuntu as those are very resource hungry.
Installing Alpine OS
Step 1
Download any alpine linux https://www.alpinelinux.org/downloads/ - i used alpine server (extended)
Step 2
Create A VM With min config in FreeNAS
Step 3
Boot into VM With VNC / Serial in FreeNAS
Step 4
Login as root -- No Password Required
Step5
Type setup-alpine
- Select your keyboard layout. i used
usandus-alt-intl - Enter Custom Hostname if required
- Select The Network Port
- Select IP Type (DHCP / Static)
- Set ROOT Password
- Set Timezone
- Follow Any Other Instructions
- for download mirror use type
fto auto select - Install SSH Server if required
- Select The Disk you want to install in eg (sda) and set it to sys to install it
- Remove Install Media And Reboot
Thats it alpine OS is now installed in that VM.
Installing Docker In Alpine
Step 1
run apk add docker Docker package is available in the Community repository.
Therefore, if apk add fails because of unjustifiable constraints error,
you need to edit the /etc/apk/repositories file to add (or comment) a line. Community repository link: http://dl-cdn.alpinelinux.org/alpine/latest-stable/community.
Step 2
run apk update && apk add docker again if repositories file edited
Step 3
- To start the Docker daemon at boot, run
rc-update add docker boot - Then to start the Docker daemon manually run
service docker start
Installing Docker Compose
Step 1
run apk add py-pip it will install Python & PIP
Step 2
Since docker-compose version 1.24.0, you also need some dev dependencies:
apk add python-dev libffi-dev openssl-dev gcc libc-dev make
Step 3
Then install docker-compose, run:
pip install docker-compose
π Wrapping Up
Do not hesitate to share your feedback
I am on Twitter varunsridharan2. Give a follow!
Follow me on Github varunsridharan, Don't miss my amazing projects! π―
