Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: fix daemon-json template #1818

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Nov 11, 2021

Issue number:
N/A

Description of changes:

Author: Erikson Tung <etung@amazon.com>
Date:   Thu Nov 11 15:52:17 2021 -0800

    docker: fix daemon-json template
    
    This fixes rendering of docker/daemon.json when
    container-registry.mirrors is not specified.

Testing done:
Launch instance with the following userdata, no container-registry.mirrors setting:

[settings.host-containers.admin]
enabled = true

[settings.host-containers.control]
enabled=true

Docker daemon.json renders correctly

bash-5.0# cat /etc/docker/daemon.json 
{
  "log-driver": "journald",
  "live-restore": true,
  "max-concurrent-downloads": 10,
  "storage-driver": "overlay2",
  "exec-opts": ["native.cgroupdriver=cgroupfs"],
  "data-root": "/var/lib/docker",
  "selinux-enabled": true,
  "default-ulimits": { "nofile": { "Name": "nofile", "Soft": 1024, "Hard": 4096 } }
}

Launch instance with the following userdata, with container-registry.mirrors setting:

[settings.host-containers.admin]
enabled = true

[settings.host-containers.control]
enabled=true

[[settings.container-registry.mirrors]]
registry = "docker.io"
endpoint = ["https://registry-0.acme.com","https://registry-1.acme.com"]

[[settings.container-registry.mirrors]]
registry = "example"
endpoint = [ "hello", "hellohello"]

Docker daemon.json renders correctly:

bash-5.0# cat /etc/docker/daemon.json 
{
  "log-driver": "journald",
  "live-restore": true,
  "max-concurrent-downloads": 10,
  "storage-driver": "overlay2",
  "exec-opts": ["native.cgroupdriver=cgroupfs"],
  "data-root": "/var/lib/docker",
  "selinux-enabled": true,
  "default-ulimits": { "nofile": { "Name": "nofile", "Soft": 1024, "Hard": 4096 } }
  ,
  "registry-mirrors": ["https://registry-0.acme.com", "https://registry-1.acme.com"]
  }
bash-5.0# 

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

This fixes rendering of docker/daemon.json when
container-registry.mirrors is not specified.
Copy link
Contributor

@samuelkarp samuelkarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming your tests are successful

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
🥧

@etungsten etungsten marked this pull request as ready for review November 12, 2021 00:18
@etungsten etungsten merged commit df3b10d into bottlerocket-os:develop Nov 12, 2021
@etungsten etungsten deleted the check-before-each branch November 12, 2021 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants