From 94ac3d6dab62ef6c3eb1de98858a9b4bdd754c7e Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sat, 18 Mar 2023 11:07:20 -0400 Subject: [PATCH] Fix cloud-init daemon.json --- stub_lxc_profile.sh | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/stub_lxc_profile.sh b/stub_lxc_profile.sh index 37fd0e4..5be1b9c 100755 --- a/stub_lxc_profile.sh +++ b/stub_lxc_profile.sh @@ -111,12 +111,28 @@ if [ "$VIRTUAL_MACHINE" = base ]; then ssh_authorized_keys: - ${SSH_AUTHORIZED_KEY} - - path: /etc/docker/daemon.json - content: | - { - "registry-mirrors": ["${REGISTRY_URL}"] - } +EOF + if [ "$REGISTRY_URL" != "https://index.docker.io/v1" ]; then + cat >> "$YAML_PATH" <> "$YAML_PATH" <