We make available a minimal Alpine Linux virtual machine with docker and sshd installed ready to be imported in Virtualbox.
- Import the appliance in Virtualbox (File->Import Appliance, accept default configuration)
- Run the machine in headless mode (Machine->Start->Headless Start)
- NEW Wait that the machine boots and then connect via ssh with
ssh docker@localhost -p2222
passworddocker
(same asroot
password) (NOTE: this has been updated due to the problems with host only network in windows 10 and now works on localhost port 2222) - NEW When you run a docker container you can use port 2223 to map any port of the container to your host. For example:
docker run -p2223:22 --rm -it mycontainer bash
binds port 22 (ssh) of
mycontainer
to port 2223. Then you can directly ssh tomycontainer
from you host using that port.
If you need to map more than one port at the same time, go to setting->network (adapter 1)->Advanced->Port Forwarding and add another entry as needed. - Run your preferred docker images
Adding extra packages
Feel free of changing the user and root password if you wish and add you preferred Alpine packages!
Make sure that /etc/apk/repositories
contains the following:
#/media/cdrom/apks http://dl-cdn.alpinelinux.org/alpine/v3.11/main http://dl-cdn.alpinelinux.org/alpine/v3.11/community #http://dl-cdn.alpinelinux.org/alpine/edge/main #http://dl-cdn.alpinelinux.org/alpine/edge/community #http://dl-cdn.alpinelinux.org/alpine/edge/testing
For example, to install docker-compose
just follow these simple steps:
alpine-docker:~$ su - Password: (root password is 'docker') alpine-docker:~# apk update ... alpine-docker:~# apk add docker-compose ... alpine-docker:~# exit alpine-docker:~$
Enjoy!