Install Alpine Linux in Virtual Box with docker

Description of your first forum.
Post Reply
admin
Site Admin
Posts: 22
Joined: Sat Jun 20, 2020 1:29 pm

Install Alpine Linux in Virtual Box with docker

Post by admin »

WHY ALPINE
Alpine is the most light weight Linux under 200 MB size which supports full fledged docker container. Alpine Linux can also be loaded on Raspberry Pi.
Its based on the musl libc library and Busy-box utilities platform.

Procedure to install Alpine Linux in Virtual Box

1. Download suitable version of alpine Linux from its website: https://www.alpinelinux.org/downloads/
2. Create a new machine in virtual box, import downloaded alpine Linux .iso file into booting media in virtual-box.
3. Select to install alpine Linux and follow instruction on GUI.
4. After installation completed open terminal for entering commands to install docker.
5.

Code: Select all

apk update.
6.

Code: Select all

vi /etc/apk/repositories

edit the repositories file and remove # at the beginning of community repositories.
Then add docker and docker composer:

Code: Select all

apk add docker docker-compose
7. Start docker at boot:

Code: Select all

rc-update add docker boot

Code: Select all

service docker start
8. Add user to Docker Group

Code: Select all

addgroup username docker
9. Test Docker ubuntu

Code: Select all

docker pull ubuntu:latest
10. Create docker container myubuntu

Code: Select all

docker create -t -i  --name myubuntu ubuntu:latest
11. Start docker container

Code: Select all

docker start myubuntu
12. Switch and Access the installed Ubuntu Container root user

Code: Select all

docker exec -it myubuntu /bin/bash
13. Exit docker container bash

Code: Select all

exit
14. Stop docker container

Code: Select all

docker stop myubuntu
15. Remove docker container myubuntu:

Code: Select all

docker rm myubuntu
16. Delete all containers:

Code: Select all

docker rm -vf $(docker ps -a -q)
17. Remove all docker images:

Code: Select all

docker rmi -f $(docker images -a -q)
So we learnt how to install docker in alpine Linux. As its lightweight Linux, docker image of different application can be tested without changing the installation. Also removing docker doesn't modify system files.
Alpine Linux doesn't come with GUI. xfce4 can be installed to access through gui.
Thanks
Admin

Post Reply