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.
This should affect the RHEL release of 'buildah' if not fixed
+++ This bug was initially created as a clone of Bug #1516431 +++
Description of problem: When creating the "whalesays" container, privilege errors on the /var/lib/apt/lists directory are seen
Version-Release number of selected component (if applicable): Buildah 0.7
Steps to Reproduce:
1. Install latest Fedora 27 Server
2. Install:
buildah-0.7-1.gitb7e3320.fc27.x86_64.rpm
skopeo-containers-0.1.26-1.git2e8377a.fc27.x86_64.rpm
container-selinux-2.33-1.fc27.noarch.rpm
3. Use this Dockerfile:
FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay
and then run this command:
buildah bud -f Dockerfile -t whale-says
Actual results:
STEP 2: RUN apt-get -y update && apt-get install -y fortunes
E: Could not open lock file /var/lib/apt/lists/lock - open (13:
Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission
denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you
root?
error building: error building at step
{Env:[PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
Command:run Args:[apt-get -y update && apt-get install -y fortunes]
Flags:[] Attrs:map[] Message:RUN apt-get -y update && apt-get install -y
fortunes Original:RUN apt-get -y update && apt-get install -y fortunes}:
exit status 100
journalctl is showing:
Nov 21 19:40:21 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0
auid=4294967295 ses=4294967295 subj=system_u:sys
tem_r:init_t:s0 msg='unit=rhel-push-plugin comm="systemd"
exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res
=success'
Nov 21 19:40:40 localhost.localdomain kernel: SELinux: mount invalid.
Same superblock, different security settings for (
dev mqueue, type mqueue)
Nov 21 19:40:40 localhost.localdomain audit[3586]: AVC avc: denied {
write } for pid=3586 comm="apt-get" name="lists"
dev="overlay" ino=154020
scontext=system_u:system_r:container_t:s0:c94,c830
tcontext=unconfined_u:object_r:container_shar
e_t:s0 tclass=dir permissive=0
Nov 21 19:40:40 localhost.localdomain audit[3586]: AVC avc: denied {
write } for pid=3586 comm="apt-get" name="lock" d
ev="overlay" ino=154026
scontext=system_u:system_r:container_t:s0:c94,c830
tcontext=unconfined_u:object_r:container_share
_t:s0 tclass=file permissive=0
Nov 21 19:40:40 localhost.localdomain audit[3586]: AVC avc: denied {
write } for pid=3586 comm="apt-get" name="dpkg" d
ev="overlay" ino=154002
scontext=system_u:system_r:container_t:s0:c94,c830
tcontext=unconfined_u:object_r:container_share
_t:s0 tclass=dir permissive=0
Nov 21 19:40:40 localhost.localdomain audit[3586]: AVC avc: denied {
write } for pid=3586 comm="apt-get" name="lock" d
ev="overlay" ino=154027
scontext=system_u:system_r:container_t:s0:c94,c830
tcontext=unconfined_u:object_r:container_share
_t:s0 tclass=file permissive=0
Nov 21 19:55:05 localhost.localdomain dhclient[1027]: DHCPREQUEST on
ens3 to 192.168.122.1 port 67 (xid=0x5db5c03b)
Expected results: Container to build without issue.
--- Additional comment from Daniel Walsh on 2017-11-22 10:48:09 EST ---
Fixed in buildah 1.8.
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/RHEA-2017:3360