This repository contains the scripts necessary to create a Vagrant box for Docker development on Alpine Linux OS.
This box is a good choice, if you work solely with Docker tools and if you would like to use a Vagrant workflow.
Please note that Alpine2Docker is currently designed for development only. Using it for any kind of production workloads is highly discouraged.
This box will be updated as soon as possible when a new Docker engine is released.
The box is available on HashiCorp's Vagrant Cloud
To use it, just open a console and type :
$ vagrant init jpbriquet/alpine2docker
$ vagrant up
- 2 vCPUs
- 4 GB memory
- 1 GB swap enabled
- Default to NAT network
- Audio and USB off
- Alpine Linux 3.7/Edge (edge repositories enabled)
- Kernel 4.9.37-0-hardened x86_64 Linux
- LVM root filesystem for any filesystem growing allocation
- Administrative user alpine (password is the same)
- OpenSSH server
- Bash, curl, sudo
- VirtualBox additions
- Docker Engine 17.12.0
- Docker Compose 1.19.0 to define and run multi-container Docker applications
- Docker Machine 0.13.0 to provision hosts on cloud providers
- Docker Bash Completion to quickly type docker commands
- Vim with Docker syntax to edit Dockerfile with style
Several options are possible to share files between the host and the vagrant box.
- Shared Folder (default). The Vagrantfile root directory content is mounted under /vagrant. It relies on native VirtualBox additions (vboxsf) which are cross-platform, convenient and reliable.
- nfs and smbfs, rsync are other alternative that have not been yet tested with this box. Ask for this feature with a github issue if you need it.
Box has been created with Packer tool and can be builded as follow.
- Make for build orchestration
- Packer as vagrant base box builder (at least version 0.12.2)
- Vagrant (at least version 1.9.1)
- VirtualBox (at least version 5.1.14)
- bats for testing
The following make command launch the box build process and tests.
make all
It is also possible to call make targets independently:
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 environmentmake 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
If you have any problems with or questions about this box, please contact us through a GitHub issue.
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
Many thanks to DDuportal for its work on boot2docker and alpine2docker Vagrant Boxes.