garethr/garethr-docker

CentOS/7 : Having "INSECURE_REGISTRY" option

Closed this issue · 1 comments

Hi there,

May I know how can I set the "INSECURE_REGISTRY" option via your puppet module. The way I did usually is to append this following line into /etc/sysconfig/docker.

INSECURE_REGISTRY="--insecure-registry="docker.registry.tamama.london""

However, this file is currently managed by this Puppet module. May I ask what is the best practice here?
(I want this option to stick with the docker daemon itself.)

Thank you very much.

Kind regards,
Tamama

The following fixes my problem.

Kind regards,
Tamama

###########################################

site/profile/manifests/docker.pp

class profile::docker {
notify { '[profile::docker] Starting ... ' : }

Package { 
    provider => 'dnf' ,
}

class { 'docker' :
    daemon_environment_files => [ '/etc/sysconfig/docker-insecure-registry' ] ,
}

file { '/etc/sysconfig/docker-insecure-registry' :
    ensure  => file ,
    content => lookup('profile::docker::etc::sysconfig::docker::insecureregistry::line') ,
    owner   => 'root' ,
    group   => 'root' ,
    mode    => '0644' ,
    notify  => Class['docker::service'] ,
}

notify { '[profile::docker] ... finished' : }

}