feat: docker service uses daemon.json from host

This commit is contained in:
Giles Bradshaw 2020-10-22 13:10:13 +01:00
parent 3b1ce6ed9f
commit cce93724fe
2 changed files with 20 additions and 46 deletions

View File

@ -34,6 +34,10 @@ function(config)
name: 'ca',
path: '/etc/docker/certs.d',
},
{
name: 'daemonjson',
path: '/etc/docker/daemon.json',
},
],
},
],
@ -48,6 +52,12 @@ function(config)
path: '/etc/docker/certs.d',
},
},
{
name: 'daemonjson',
host: {
path: '/etc/docker/daemon.json',
},
},
],
steps:[
compose(

View File

@ -25,6 +25,10 @@ function(config)
name: 'ca',
path: '/etc/docker/certs.d',
},
{
name: 'daemonjson',
path: '/etc/docker/daemon.json',
},
],
},
],
@ -39,6 +43,12 @@ function(config)
path: '/etc/docker/certs.d',
},
},
{
name: 'daemonjson',
host: {
path: '/etc/docker/daemon.json',
},
},
],
steps:[
images(config).docker {
@ -62,49 +72,3 @@ function(config)
'dockerconfigjson'
]
}
/*
local steps = import '../steps/steps.libsonnet';
local docker = import '../docker.libsonnet';
local images = import '../images.libsonnet';
local util = import '../util.libsonnet';
function(config)
function(trigger)
[
docker(config).pipeline {
name: 'registry',
trigger: trigger,
steps: [
images(config).docker {
name +: 'build docker images:',
environment +: util.environment([
'LOCAL_DOCKER_REGISTRY',
'LOCAL_REGISTRY_PASSWORD',
]),
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
],
commands: [
'set -e',
'sleep 40',
'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${LOCAL_REGISTRY_PASSWORD}"',
'sh jsonnet/lib/initialise-images.sh %(registry)s' % config,
'docker logout $${LOCAL_DOCKER_REGISTRY}',
],
},
],
services +: [
docker(config).service,
],
volumes +: docker(config).volumes,
},
]
*/