Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (40 sloc) 2.01 KB
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# For a complete reference, please see the online documentation at
# Prefer bento box over official ubuntu ones = "bento/ubuntu-18.04"
# Create a private network and give VM a static IP "private_network", ip: "" "forwarded_port", guest: 2375, host: 2375 # Docker daemon "forwarded_port", guest: 80, host: 8081 # IDE containers (traefik) "forwarded_port", guest: 389, host: 389 # LDAP server
# Enable the automatic install of docker and make it available via TCP
# We bind to because the VM and Host are on a private network
# The Docker daemon is then available at
# Access via command-line e.g.:
# $ export DOCKER_HOST='tcp://'
# $ docker ps -a
config.vm.provision "docker" do |d|
# Run Traefik as reverse proxy inside the VM
# It is available on port 8081 on the host "traefik",
cmd: "--loglevel=info --docker=true --docker.exposedbydefault=false",
args: "-p 80:80 -v /var/run/docker.sock:/var/run/docker.sock" "portainer/portainer", # credentials admin:admin
cmd: "-H unix:///var/run/docker.sock --admin-password='$2y$05$n8b3wSfBtMdMY1ei4FBx..qbvqlHx7Rpln7Wd61HQYcIJ7pWgGH7q'",
args: '-v /var/run/docker.sock:/var/run/docker.sock -l="traefik.enable=true" -l="traefik.frontend.rule=PathPrefixStrip: /portainer/" -l="traefik.port=9000" --name portainer'
# Make daemon accessible via tcp and restart to apply changes
d.post_install_provision "shell", inline: <<-eol
sed -i '/ExecStart=/c\ExecStart=/usr/bin/dockerd -H fd:// -H tcp:// --containerd=/run/containerd/containerd.sock' /lib/systemd/system/docker.service \
&& systemctl daemon-reload \
&& systemctl restart docker.service
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
You can’t perform that action at this time.