通过木偶安装docker-ce
我试图通过木偶安装docker-ce,我有几个问题。
1:之后,apt :: key会自动执行“apt-get update”吗?
2:如何使用apt:ppa模块添加docker-ce 存储库 ? 这是通过:
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
但是,我将如何使用apt :: ppa来包含分发和发布?
这是整个木偶块:
class docker { $prerequisites = ['apt-transport-https', 'ca-certificates', 'curl'] package { $prerequisites: ensure => installed} apt::key { 'docker-ce': ensure => present, id => '9DC858229FC7DD38854AE2D88D81803C0EBFCD88', options => 'https://download.docker.com/linux/ubuntu/gpg', } apt::ppa {''} package {'docker-ce': ensure => installed} }
编辑:
结束使用apt :: source的apt模块,硬编码版本,因为我知道我所有的系统都会运行它。
class docker { include apt $prerequisites = ['apt-transport-https', 'ca-certificates'] package { $prerequisites: ensure => installed} -> apt::key { 'docker-ce': ensure => present, id => '9DC858229FC7DD38854AE2D88D81803C0EBFCD88', options => 'https://download.docker.com/linux/ubuntu/gpg', } -> apt::source {'docker-ce': location => 'https://download.docker.com/linux/ubuntu', release => 'xenial' } -> exec { 'apt-get-update': command => '/usr/bin/apt-get update' } -> package {'docker-ce': ensure => installed} }