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>
This commit is contained in:
Matt Spencer 2019-08-28 17:23:36 +01:00 committed by Bruce Ashfield
parent 7e2c4151c5
commit 150f1857bb
3 changed files with 13 additions and 4 deletions

View File

@ -112,8 +112,12 @@ do_install() {
install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
fi fi
# TLS key that docker creates at run-time if not found is what resides here # TLS key that docker creates at run-time if not found is what resides here
if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
install -d ${D}${sysconfdir} install -d ${D}${sysconfdir}
ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker
else
install -d ${D}${sysconfdir}/docker
fi
mkdir -p ${D}${datadir}/docker/ mkdir -p ${D}${datadir}/docker/
install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/ install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/

View File

@ -132,8 +132,12 @@ do_install() {
install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
fi fi
# TLS key that docker creates at run-time if not found is what resides here # TLS key that docker creates at run-time if not found is what resides here
if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
install -d ${D}${sysconfdir} install -d ${D}${sysconfdir}
ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker
else
install -d ${D}${sysconfdir}/docker
fi
mkdir -p ${D}${datadir}/docker/ mkdir -p ${D}${datadir}/docker/
install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/ install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/

View File

@ -44,6 +44,7 @@ inherit pkgconfig
PACKAGECONFIG ??= "docker-init" PACKAGECONFIG ??= "docker-init"
PACKAGECONFIG[seccomp] = "seccomp,,libseccomp" PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
PACKAGECONFIG[docker-init] = ",,,docker-init" PACKAGECONFIG[docker-init] = ",,,docker-init"
PACKAGECONFIG[transient-config] = "transient-config"
inherit systemd update-rc.d inherit systemd update-rc.d