Running a container image with docker causes a tmpfs being mounted into the container's filesystem
This document (000021288) is provided subject to the disclaimer at the end of this document.
Environment
Situation
host:~ # docker run -d --rm registry.k8s.io/e2e-test-images/agnhost:2.39 ce445d41ea060216f7985015d9ba0780aa958a1df4605ca414bcc210b28fd8de host:~ # mount | grep ce445d4 tmpfs on /var/lib/docker/containers/ce445d41ea060216f7985015d9ba0780aa958a1df4605ca414bcc210b28fd8de/mounts/secrets type tmpfs (ro,relatime,inode64) host:~ # ls /var/lib/docker/containers/ce445d4*/mounts/secrets/ suse_81696772d781afd0ff3038714a81da303a4b152371ba4854f8d6426317f73ce9_credentials.d suse_827d94d93c7563d2fefc81254e5233528eccc7781033af071f34d37dbe220488_SUSEConnect host:~ # docker exec -it ce445d4 /bin/sh / # ls /run/secrets/ SUSEConnect credentials.d/ / #
Resolution
Cause
This mechanism safely provides a container with access to the product registration credentials of the host system. It authorizes zypper to access SUSE Linux Enterprise repositories or patches without further need to adjust the Dockerfile or a Compose file from within the container, provided that the host system is properly registered.
It is implemented with a SUSE specific patch to dockerd. Whether a specific build of Docker has the patch included can be determined by dockerd's start log message
SUSE:secrets :: enabled
(check the output of "journalctl -u docker")
For podman, the container-suseconnect plugin exists.
As the repository credentials only need a very small amount of RAM, the additional tmpfs mounts should not have any noticeable effect on the system.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021288
- Creation Date: 06-Dec-2023
- Modified Date:06-Dec-2023
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com