Puppet Class: profile::toolforge::docker::image_builder

Defined in:
modules/profile/manifests/toolforge/docker/image_builder.pp

Overview

Parameters:

  • docker_username (String) (defaults to: lookup('docker::username'))
  • docker_password (String) (defaults to: lookup('docker::password'))
  • docker_registry (Stdlib::Fqdn) (defaults to: lookup('docker::registry'))
  • component (String) (defaults to: lookup('profile::wmcs::kubeadm::component', {default_value => 'thirdparty/kubeadm-k8s-1-21'}))


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'modules/profile/manifests/toolforge/docker/image_builder.pp', line 1

class profile::toolforge::docker::image_builder(
    String       $docker_username = lookup('docker::username'),
    String       $docker_password = lookup('docker::password'),
    Stdlib::Fqdn $docker_registry = lookup('docker::registry'),
    String $component = lookup('profile::wmcs::kubeadm::component', {default_value => 'thirdparty/kubeadm-k8s-1-21'}),
) {
    # This should be building with the same docker we are running
    class { '::kubeadm::repo':
        component => $component,
    }

    labs_lvm::volume { 'docker':
        size      => '70%FREE',
        mountat   => '/var/lib/docker',
        mountmode => '711',
    } -> class {'profile::labs::lvm::srv': }

    class { '::kubeadm::docker': }

    class { '::docker::baseimages':
        docker_registry => $docker_registry,
    }

    git::clone { 'operations/docker-images/toollabs-images':
        ensure    => present,
        directory => '/srv/images/toolforge',
    }

    git::clone { 'cloud/toolforge/buildpacks':
        ensure    => present,
        directory => '/srv/buildpacks',
    }

    # Available in Toolforge's aptly repo
    ensure_packages(['pack'])

    # Registry credentials require push privileges
    docker::credentials { '/root/.docker/config.json':
        owner             => 'root',
        group             => 'docker',
        registry          => $docker_registry,
        registry_username => $docker_username,
        registry_password => $docker_password,
    }
}