Skip to content

A Vagrant Alpine Linux VM with docker and other tools for developers

Notifications You must be signed in to change notification settings

jpbriquet/alpine2docker4dev

 
 

Repository files navigation

Alpine2docker4dev Vagrant Box

Logo + Logo + Logo

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.

Usage

The box is available on HashiCorp's Vagrant Cloud

To use it, just open a console and type :

$ vagrant init jpbriquet/alpine2docker
$ vagrant up

What's in the box ?

VM

  • 2 vCPUs
  • 4 GB memory
  • 1 GB swap enabled
  • Default to NAT network
  • Audio and USB off

Guest OS

  • 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 Tools

  • 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

Synced folder

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.

Building the Box

Box has been created with Packer tool and can be builded as follow.

Requirements

Building the box

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 build
  • make clean-box: Remove any packer final or intermediate artifacts
  • make prepare-test: Copy the latest built box to the test environment
  • make test: Run the test suite using vagrant
  • make clean-test: Clean any test artifacts or VM
  • make clean: Clean everything

Extension point

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

User Feedback

Issues

If you have any problems with or questions about this box, please contact us through a GitHub issue.

Contributing

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.

Thanks

Many thanks to DDuportal for its work on boot2docker and alpine2docker Vagrant Boxes.

About

A Vagrant Alpine Linux VM with docker and other tools for developers

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 85.6%
  • Smarty 7.7%
  • Makefile 6.7%