summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spencer <matthew@thespencers.me.uk>2019-08-28 17:23:36 +0100
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-09-24 20:36:00 -0400
commit150f1857bba2df9dc4b78f08bd93603a18192b0a (patch)
treef4f0bfda9c3c8cbdd58164c4eaf06c1b29990b14
parent7e2c4151c53463140bcb8f6bc5b2b27cbbf6dff8 (diff)
downloadmeta-virtualization-150f1857bba2df9dc4b78f08bd93603a18192b0a.tar.gz
docker: add transient configuration packageconfig
Since commit: [ Author: Tom Rini <trini@konsulko.com> Date: Fri Feb 8 13:22:35 2019 -0500 docker: Move /etc/docker to a symlink to volatiles The only thing which docker uses /etc/docker for is a TLS key for connecting with other TLS-enabled services. Make /etc/docker a symlink to the existing docker volatiles directory so that we can use docker on a read-only rootfs. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ] We've had a transient / volatile docker configuration since we point our /etc configuration to /run. This is not always a good thing if a static configuration for keys, etc, is desired. We maintain this functionality under the 'transient-config' PACKAGECONFIG, and also allow the existing static/permanent config to be used. Signed-off-by: Matt Spencer <matthew@thespencers.me.uk> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/docker/docker-ce_git.bb8
-rw-r--r--recipes-containers/docker/docker-moby.bb8
-rw-r--r--recipes-containers/docker/docker.inc1
3 files changed, 13 insertions, 4 deletions
diff --git a/recipes-containers/docker/docker-ce_git.bb b/recipes-containers/docker/docker-ce_git.bb
index 52b146d2..817795f0 100644
--- a/recipes-containers/docker/docker-ce_git.bb
+++ b/recipes-containers/docker/docker-ce_git.bb
@@ -112,8 +112,12 @@ do_install() {
112 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init 112 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
113 fi 113 fi
114 # TLS key that docker creates at run-time if not found is what resides here 114 # TLS key that docker creates at run-time if not found is what resides here
115 install -d ${D}${sysconfdir} 115 if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
116 ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker 116 install -d ${D}${sysconfdir}
117 ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker
118 else
119 install -d ${D}${sysconfdir}/docker
120 fi
117 121
118 mkdir -p ${D}${datadir}/docker/ 122 mkdir -p ${D}${datadir}/docker/
119 install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/ 123 install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/
diff --git a/recipes-containers/docker/docker-moby.bb b/recipes-containers/docker/docker-moby.bb
index e45f87e0..2ba1d276 100644
--- a/recipes-containers/docker/docker-moby.bb
+++ b/recipes-containers/docker/docker-moby.bb
@@ -132,8 +132,12 @@ do_install() {
132 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init 132 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
133 fi 133 fi
134 # TLS key that docker creates at run-time if not found is what resides here 134 # TLS key that docker creates at run-time if not found is what resides here
135 install -d ${D}${sysconfdir} 135 if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
136 ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker 136 install -d ${D}${sysconfdir}
137 ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker
138 else
139 install -d ${D}${sysconfdir}/docker
140 fi
137 141
138 mkdir -p ${D}${datadir}/docker/ 142 mkdir -p ${D}${datadir}/docker/
139 install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/ 143 install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/
diff --git a/recipes-containers/docker/docker.inc b/recipes-containers/docker/docker.inc
index 8b1b123c..0083902f 100644
--- a/recipes-containers/docker/docker.inc
+++ b/recipes-containers/docker/docker.inc
@@ -44,6 +44,7 @@ inherit pkgconfig
44PACKAGECONFIG ??= "docker-init" 44PACKAGECONFIG ??= "docker-init"
45PACKAGECONFIG[seccomp] = "seccomp,,libseccomp" 45PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
46PACKAGECONFIG[docker-init] = ",,,docker-init" 46PACKAGECONFIG[docker-init] = ",,,docker-init"
47PACKAGECONFIG[transient-config] = "transient-config"
47 48
48inherit systemd update-rc.d 49inherit systemd update-rc.d
49 50