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 17.06 cannot get #735

Open
rohitbordia opened this issue Nov 2, 2017 · 7 comments
Open

Docker 17.06 cannot get #735

rohitbordia opened this issue Nov 2, 2017 · 7 comments

Comments

@rohitbordia
Copy link

How, do we get docker 17.06 , when tagging with version "latest" it gets

Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:06:25 2017
OS/Arch: linux/amd64

Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:06:25 2017
OS/Arch: linux/amd64
Experimental: false

@Justin-DynamicD
Copy link

You need to update your repo. The defautl repo in this module is out of date.

So for example, in ubuntu my hiera.yaml contains:

docker_package_name: 'docker-ce'
docker_package_source_location: 'https://download.docker.com/linux/centos/docker-ce.repo'

@rohitbordia
Copy link
Author

rohitbordia commented Nov 2, 2017 via email

@Justin-DynamicD
Copy link

as an fyi, this seems to have been forked by the puppet team, This module may be on it's way to pasture:

https://forge.puppet.com/puppetlabs/docker

@Justin-DynamicD
Copy link

Justin-DynamicD commented Nov 2, 2017

I'm sorry, I forgot my hiera doesn't translate properly ... let me do this again in puppet DSL:

package_name => $docker_package_name, package_source_location => $docker_package_source_location,

Hope that's a bit more clear.

@rohitbordia
Copy link
Author

rohitbordia commented Nov 2, 2017 via email

@rohitbordia
Copy link
Author

any idea why it cannot find docker-ce

@davidius81
Copy link

davidius81 commented Nov 10, 2017

Yup, because your specified the Repo file instead of the yum url,

The module has still useful features but it doesn't support the new packages, specially because the $docker_command variable now differ from daemon_command and the module is not support it at the moment. So I decided to install the package myself and use the feature I want after.

Here is what I have done:

I kept my example simple but I have also enabled the tls in my environment.

my hiera data looks like this.

docker:
   daemon:
    experimental: true
    insecure-registries:
    - myrepostiroy:5000
    hosts:
    - tcp://0.0.0.0:2376
    - unix:///var/run/docker.sock
    storage-driver: devicemapper
    storage-opts:
    - dm.directlvm_device=/dev/sdc
    - dm.thinp_percent=95
    - dm.thinp_metapercent=1
    - dm.thinp_autoextend_threshold=80
    - dm.thinp_autoextend_percent=20
    - dm.directlvm_device_force=false
    log-driver: "json-file"
    log-opts:
      max-size: "10m"
      max-file: "3"

In my profile I fetch the configuration as follow:

Hash $docker_daemon   = hiera('docker.daemon',undef),
 
 # Convert my puppet hash to json
  $docker_daemon_template = @(END)
  <%= require "json"; JSON.pretty_generate @docker_daemon%>
  END

  file { '/etc/docker/daemon.json':
    ensure => file,
    owner  => root,
    group  => root,
    mode   => '644',
    content =>  inline_template($docker_daemon_template),
    notify  => Exec['Reload Docker Configuration'],
  }

  yumrepo { 'docker-ce-stable':
    descr    => 'Docker CE Stable - $basearch',
    baseurl  => 'https://download.docker.com/linux/centos/7/$basearch/stable',
    gpgkey   => 'https://download.docker.com/linux/centos/gpg',
    gpgcheck => true,
  }

  package { "docker-ce": 
    ensure => "installed",
    require => Yumrepo['docker-ce-stable'],
    }  

  service { "docker":
    ensure     => running,
    enable     => true,
    hasrestart => true,
    hasstatus  => true,
    require    => [
                    Package['docker-ce'],
                    File['/etc/docker/daemon.json'],
                  ],
  }

exec { 'Reload Docker Configuration':
    command => "/bin/systemctl reload docker",
    refreshonly => true,
  }

I hope this will help others!

Have fun:)

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

No branches or pull requests

3 participants