Drupal Lxc Vagrant Docker

Deploy and develop on Drupal with LXC, Vagrant and Docker. Includes: nginx,php-fpm,apc,xhprof,mysql,phpmyadim,composer
Alternatives To Drupal Lxc Vagrant Docker
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
a day ago118otherJava
Source for the TechEmpower Framework Benchmarks project
Ansible For Devops6,946
6 days ago98mitPython
Ansible for DevOps examples.
Shutit2,10823a year ago635June 29, 20229mitPython
Automation framework for programmers
Infrastructure As Code Tutorial2,065
7 months ago11apache-2.0
Infrastructure As Code Tutorial. Covers Packer, Terraform, Ansible, Vagrant, Docker, Docker Compose, Kubernetes
6 days ago6mitHCL
This is my personal template collection. Here you'll find templates, and configurations for various tools, and technologies.
Ansible Vagrant Examples1,988
6 months ago1mit
Ansible examples using Vagrant to deploy to local VMs.
2 months ago77mitRust
Vagga is a containerization tool without daemons
Kubernetes Vagrant Centos Cluster1,827
10 months ago17apache-2.0Shell
Setting up a distributed Kubernetes cluster along with Istio service mesh locally with Vagrant and VirtualBox, only PoC or Demo use.
2 years ago41gpl-3.0Python
A cryptocurrency trading environment using deep reinforcement learning and OpenAI's gym
Learning Tools1,434
2 months ago3mitPython
A collection of tools and files for learning new technologies
Alternatives To Drupal Lxc Vagrant Docker
Select To Compare

Alternative Project Comparisons


What are these?

LXC is a lightweight virtualization method that provides operating system-level virtualization optional to an heavy full virtual machine. It relies on the Linux kernel cgroups functionality that became available in version 2.6.24, It provides a virtual environment that has its own process and network space. This option makes the perfect option for deploying several contained Drupal dev environments independent of the distribution.Docker is a solution from dotCloud, which simplifies and improves the process of creating and managing Linux containers. Vagrant 1.1+ lxc plugin allows it to control and provision Linux Containers as an alternative to the built in (and heavy) Vagrant VirtualBox provider for Linux hosts.

Deploy and develop on Drupal with LXC, using Vagrant and/or Docker.

Takes about ~2 minutes to have a full running Drupal development box. Installing Drupal on lxc containers has never been faster and easier.

You will get:

  1. Drupal (latest version)
  2. Nginx
  3. Php + php-fpm
  4. Mysql
  5. Phpmyadmin
  6. xhprof
  7. xdebug
  8. composer


Install latest Vagrant from: http://downloads.vagrantup.com/tags/v1.3.5 or later.

sudo dpkg -i vagrant_1.3.5_x86_64.deb
sudo apt-get install lxc redir git sudo

Clone this code

git clone https://github.com/ricardoamaro/drupal-lxc-vagrant-docker.git
cd ~/drupal-lxc-vagrant-docker

Get the plugin & Deploy

vagrant plugin install vagrant-lxc
vagrant up --provider=lxc 
sudo lxc-ls --fancy

Configue Networking

# redirect port 80 to the host
sudo redir --lport=80 --cport=80 --caddr={container ip} &

your /etc/hosts file should have a line like this:	drupal phpmyadmin xhprof

Develop on Drupal

Stop/start lxc container with:

~/drupal-lxc-vagrant-docker# vagrant halt
~/drupal-lxc-vagrant-docker# vagrant up --no-provision

Debug vagrant build if necessary, with:

~/drupal-lxc-vagrant-docker# VAGRANT_LOG=debug vagrant up --provider=lxc

Destroy lxc container with:

~/drupal-lxc-vagrant-docker# vagrant destroy
~/drupal-lxc-vagrant-docker# sudo killall redir


Docker will be used to ship our newly created appliance, deploying it to any linux server, anywhere in the world, whitin a container.

Install docker

sudo apt-get -y install lxc-docker
curl get.docker.io | sudo sh -x

Import container to docker:

sudo tar -C /var/lib/lxc/{container name}/rootfs/ -c . | sudo docker import - dev/drupal

Start docker

sudo docker run -i -t -p :80 dev/drupal /bin/bash

docker image

An already cooked Docker image has been commited to https://index.docker.io, and can be pulled using:

sudo docker pull ricardoamaro/drupal

*There is also a project to build a simple lamp image with Drupal, using Dockerfile: ricardoamaro/docker-drupal

*You can find more images using the Docker Index.

*Information on building your own vagrant-lxc base box: http://fabiorehm.com/blog/2013/07/18/crafting-your-own-vagrant-lxc-base-box/

Future ideas:

  • Since this a pure devops work towards actual running production environments, one of the primary targets is to deploy to the cloud using several hosts to achieve a real hosting structure.
  • Using the shipping container concept of docker it would be great to have the container fill up the several jobs that Drupal work with, like:
  • Separated mysql/mariadb,
  • Redis,
  • Solr,
  • Varnish,
  • Load balancers...

Known Issues

  • Upstart on Docker is broken due to this issue, and that's one of the reasons the image is puppetized using vagrant.
  • Warning: This is still in development and ports shouldn't be open to the outside world.
  • The vagrant uses the vagrant pub ssh key, but you can remove that while using lxc-attach -n {container name}


Feel free to fork and contribute to this code. :)

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request


Created and maintained by Ricardo Amaro (<mail_at_ ricardoamaro.com>)



Special Thank you

To these projects for their awesome code: fgrehm/vagrant-lxc mitchellh/vagrant dotcloud/docker puppet/puppet and to all other FreeSoftware used on this repo, including the fabulous http://drupal.org

Popular Docker Projects
Popular Vagrant Projects
Popular Virtualization Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.