Install Alpine Linux in Virtual Box with docker
Posted: Sun Jun 04, 2023 2:19 pm
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.
6.
edit the repositories file and remove # at the beginning of community repositories.
Then add docker and docker composer:
7. Start docker at boot:
8. Add user to Docker Group
9. Test Docker ubuntu
10. Create docker container myubuntu
11. Start docker container
12. Switch and Access the installed Ubuntu Container root user
13. Exit docker container bash
14. Stop docker container
15. Remove docker container myubuntu:
16. Delete all containers:
17. Remove all docker images:
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
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.
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
Code: Select all
rc-update add docker boot
Code: Select all
service docker start
Code: Select all
addgroup username docker
Code: Select all
docker pull ubuntu:latest
Code: Select all
docker create -t -i --name myubuntu ubuntu:latest
Code: Select all
docker start myubuntu
Code: Select all
docker exec -it myubuntu /bin/bash
Code: Select all
exit
Code: Select all
docker stop myubuntu
Code: Select all
docker rm myubuntu
Code: Select all
docker rm -vf $(docker ps -a -q)
Code: Select all
docker rmi -f $(docker images -a -q)
Alpine Linux doesn't come with GUI. xfce4 can be installed to access through gui.
Thanks
Admin