Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Docker-latest could not run systemd container without privilege or seccomp
Version-Release number of selected component (if applicable):
docker-latest-1.13.1-4.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Build a httpd systemd container, use Dockerfile as below:
$ cat Dockerfile
FROM rhel7
RUN yum -y update && yum clean all
RUN yum -y install httpd && yum clean all && \
systemctl enable httpd.service
EXPOSE 80
RUN echo "systemd httpd server" > /var/www/html/index.html
RUN systemctl mask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service getty.target console-getty.service
RUN cp /usr/lib/systemd/system/dbus.service /etc/systemd/system/; sed -i 's/OOMScoreAdjust=-900//' /etc/systemd/system/dbus.service
VOLUME ["/run", "/tmp"]
ENV container=docker
CMD ["/usr/sbin/init"]
2. run it by docker is ok.
$ sudo docker run -it --rm -p 80:80 -v /sys/fs/cgroup:/sys/fs/cgroup gouyang/httpd
systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization docker.
Detected architecture x86-64.
Welcome to Red Hat Enterprise Linux Server 7.3 (Maipo)!
3. run it by docker-latest is failed
$ sudo docker-latest run -it --rm -p 80:80 -v /sys/fs/cgroup:/sys/fs/cgroup gouyang/httpd
[!!!!!!] Failed to mount API filesystems, freezing.
4. run it by docker-latest with privilege is ok
$ sudo docker-latest run -it --rm --privileged -p 80:80 -v /sys/fs/cgroup:/sys/fs/cgroup gouyang/httpd
systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization docker.
Detected architecture x86-64.
Welcome to Red Hat Enterprise Linux Server 7.3 (Maipo)!
5. run it by docker-latest with seccomp is ok
$ sudo docker-latest run -it --rm --security-opt seccomp:unconfined -p 80:80 -v /sys/fs/cgroup:/sys/fs/cgroup gouyang/httpd
systemd 219 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization docker.
Detected architecture x86-64.
Welcome to Red Hat Enterprise Linux Server 7.3 (Maipo)!
Actual results:
Step 3 failed
Expected results:
The behaviour of Docker-latest and Docker should be consistence
Additional info:
Reference github issue https://github.com/docker/docker/issues/25290
As a workaround mentioned above, it needs --security-opt seccomp:unconfined to disable seccomp to get systemd container working with docker-latest here.
Alright, let's get this fixed. Fedora docker-latest already ships `/etc/docker-latest/seccomp.json`:
643 # install %%{repo} config directory
644 install -dp %{buildroot}%{_sysconfdir}/%{name}
645 # install defalut seccomp profile
646 install -p -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/%{name}/seccomp.json
Lokesh, we need the same for RH docker-latest dist-git and also modify the systemd unit to have:
15 --seccomp-profile=/etc/docker-latest/seccomp.json \
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2017:1330