From c23a89362cb6a56b61529d70f9ea54f81c958dd8 Mon Sep 17 00:00:00 2001 From: Gonzalo Reyero Ferreras <87083379+greyerof@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:26:19 +0100 Subject: [PATCH] ubuntu bootstrapping: modify docker cfg instead of full rewrite. (#395) Adding ipv6 support for docker bootstrapping on ubuntu was rewriting the full docker daemon.json config file. This change just adds (or overwrites) the required fields to add ipv6 support. This will allow switching docker storage to /mnt in our github ci workflows right at the beginning on each job, instead of doing it right after this script had rewritten. --- config/vagrant/scripts/bootstrap-docker-ubuntu.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/config/vagrant/scripts/bootstrap-docker-ubuntu.sh b/config/vagrant/scripts/bootstrap-docker-ubuntu.sh index c38b35a1..4a49cc8b 100755 --- a/config/vagrant/scripts/bootstrap-docker-ubuntu.sh +++ b/config/vagrant/scripts/bootstrap-docker-ubuntu.sh @@ -1,12 +1,9 @@ #!/usr/bin/env bash -# update docker config -sudo bash -c 'cat <<- EOF > /etc/docker/daemon.json -{ - "ipv6": true, - "fixed-cidr-v6": "2001:db8:1::/64" -} -EOF' +# update docker config to include ipv6 support +jq '. +={"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64"}' /etc/docker/daemon.json > /tmp/new-docker-daemon.json +sudo cp /tmp/new-docker-daemon.json /etc/docker/daemon.json +rm /tmp/new-docker-daemon.json # restart docker sudo systemctl restart docker