nurtext / alpine2docker

A Lightweight Vagrant VM to quickly run docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alpine2docker Vagrant Box

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.

Usage

The box is available on Hashicorp's Vagrant Cloud, making it very easy to use it:

$ vagrant init nurtext/alpine2docker
$ vagrant up
  • Guest OS: Alpine Linux 3.9
  • LVM root filesystem for any filesystem growing allocation
  • 1 Gb swap enabled
  • Default to NAT network
  • Default to 2 vCPUs and 2 Gb memory
  • OpenSSH server
  • Bash, curl, sudo, rsync
  • Administrative user alpine (password is the same)
  • Docker Engine
  • Docker Compose
  • Docker Bash Completion
  • Virtual Box Guest Additions (e.g. for shared filesystems)
  • NOT in the box:
    • No USB
    • No Audio

Building the Box

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.

Requirements

Building the box

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 build
  • make clean-box: Remove any packer final or intermediate artifacts
  • make prepare-test: Copy the latest built box to the test environement
  • 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

About

A Lightweight Vagrant VM to quickly run docker


Languages

Language:Shell 80.6%Language:Makefile 10.7%Language:Smarty 8.7%