This repository contains the scripts necessary to create a lightweight Vagrant box for running docker, based on Alpine Linux OS.
If you work solely with Docker, this box lets you keep your Vagrant workflow and work in the most minimal Docker environment possible.
The box is available on Hashicorp's Atlas, making it very easy to use it:
vagrant init dduportal/alpine2docker
vagrant up
- Guest OS: Alpine Linux
- LVM root filesystem for any filesystem growing allocation
- 1 Gb swap enabled
- Default to NAT network
- Default to 2 vCPUs and 4 Gb memory
- OpenSSH server
- Bash, curl, sudo, rsync
- Administrative user alpine (password is the same)
- Docker Engine
- Docker Compose
- Docker Bash Completion
- NOT in the box:
- No VirtualBox addition (meaning: no shared filesystem with the host by default, unless using rsync)
- No USB
- No Audio
If you want to recreate the box, rather than using the binary, then you can use the scripts and Packer template within this repository to do so in seconds.
- Make as workflow engine
- Packer as vagrant basebox builder (at least version 1.0.0)
- Vagrant (at least version 1.9.4)
- VirtualBox (at least version 5.1.22)
- bats for testing
Then run this command to build the box and run the test suite:
make all
You can also run the make targets independently for a quick feedback loop:
make box
: Only run the packer buildmake clean-box
: Remove any packer final or intermediate artifactsmake prepare-test
: Copy the latest built box to the test environementmake test
: Run the test suite using vagrantmake clean-test
: Clean any test artifacts or VMmake clean
: Clean everything
If you want to tune the behavior to fit your needs, but want to reuse all the build process, here is the workflow for VM customization:
- Add this repository as a git submodule of your repository
- Put in the
customize
folder the content you want to be uploaded to the VM- You can overwrite existing content: it is for demo purpose
- The content will be uploaded inside /var/customize
- If there is a script
run.sh
, it will be run during box build time
- Build the VM with the previous instructions