From d064352a47fbf8ac54000704f9a409d63d2d278d Mon Sep 17 00:00:00 2001 From: Thomas Rausch Date: Tue, 8 May 2018 17:38:04 +0200 Subject: [PATCH] Update vagrant configuration --- .gitignore | 7 ++++++- vm/Vagrantfile | 6 ++++++ vm/docker-configure.sh | 22 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 vm/docker-configure.sh diff --git a/.gitignore b/.gitignore index 2f9bcb9..20f12c2 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,9 @@ bin/* *.iws .idea -*/.vagrant/* +#backup-files +*~ + +# vagrant +.vagrant/ + diff --git a/vm/Vagrantfile b/vm/Vagrantfile index a2f1230..17562fa 100644 --- a/vm/Vagrantfile +++ b/vm/Vagrantfile @@ -9,4 +9,10 @@ Vagrant.configure("2") do |config| # Prefer VirtualBox before VMware Fusion config.vm.provider "virtualbox" config.vm.provider "vmware_fusion" + + # shared folders + config.vm.synced_folder "../", "/dst" + + # provision + config.vm.provision "shell", path: "docker-configure.sh" end diff --git a/vm/docker-configure.sh b/vm/docker-configure.sh new file mode 100644 index 0000000..2e75a13 --- /dev/null +++ b/vm/docker-configure.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +VM_IP="192.168.99.99" + +echo "[docker-configure] Creating docker.conf to overwrite ExecStart" +mkdir -p /etc/systemd/system/docker.service.d +cat < /etc/systemd/system/docker.service.d/docker.conf +[Service] +ExecStart= +ExecStart=/usr/bin/dockerd +EOF + +echo "[docker-configure] Creating daemon.json docker config" +cat < /etc/docker/daemon.json +{"hosts":["unix:///var/run/docker.sock","tcp://${VM_IP}:2375"]} +EOF + +echo "[docker-configure] Reloading systemd" +systemctl daemon-reload + +echo "[docker-configure] Restarting docker" +systemctl restart docker -- 2.43.0