From 150f1857bba2df9dc4b78f08bd93603a18192b0a Mon Sep 17 00:00:00 2001 From: Matt Spencer Date: Wed, 28 Aug 2019 17:23:36 +0100 Subject: docker: add transient configuration packageconfig Since commit: [ Author: Tom Rini 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 Signed-off-by: Bruce Ashfield ] 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 Signed-off-by: Bruce Ashfield --- recipes-containers/docker/docker-ce_git.bb | 8 ++++++-- recipes-containers/docker/docker-moby.bb | 8 ++++++-- recipes-containers/docker/docker.inc | 1 + 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() { install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init fi # TLS key that docker creates at run-time if not found is what resides here - install -d ${D}${sysconfdir} - ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker + if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then + install -d ${D}${sysconfdir} + ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker + else + install -d ${D}${sysconfdir}/docker + fi mkdir -p ${D}${datadir}/docker/ 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() { install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init fi # TLS key that docker creates at run-time if not found is what resides here - install -d ${D}${sysconfdir} - ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker + if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then + install -d ${D}${sysconfdir} + ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker + else + install -d ${D}${sysconfdir}/docker + fi mkdir -p ${D}${datadir}/docker/ 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 PACKAGECONFIG ??= "docker-init" PACKAGECONFIG[seccomp] = "seccomp,,libseccomp" PACKAGECONFIG[docker-init] = ",,,docker-init" +PACKAGECONFIG[transient-config] = "transient-config" inherit systemd update-rc.d -- cgit v1.2.3-54-g00ecf