sed -i 's/endpoint = \["https:\/\/registry-1\.docker\.io"\]/endpoint = {{ append .dockerRegistryMirrors "https://registry-1.docker.io" | toJson | replace "/" "\\/" | replace "[" "\\[" | replace "]" "\\]" }}/' /etc/containerd/config.toml
{{- end }}
systemctl restart containerd
-{{- else if eq .containerRuntime "docker" -}}
-- path: /usr/local/bin/install-container-runtime.sh
- permissions: '0777'
- content: |
- #!/usr/bin/env bash
- set -eux -o pipefail
- apt-get install -y docker-ce={{ .dockerVersion }} docker-ce-cli={{ .dockerVersion }} containerd.io={{ .containerdVersion }}
- systemctl enable --now docker
- usermod -aG docker ubuntu
-- path: /etc/docker/daemon.json
- content: |
- {
- "exec-opts": ["native.cgroupdriver=systemd"],
- "log-driver": "json-file",
- "log-opts": {
- "max-size": "100m"
- },
-{{- if .dockerRegistryMirrors }}
- "registry-mirrors": {{ .dockerRegistryMirrors | toJson }}
-{{- end }}
- "storage-driver": "overlay2"
- }
-{{- end }}
{{- end }}
+{{- end }}
\ No newline at end of file