Bug 21810

Summary: Nspawn enabled in mock causes issues running mock in docker.
Product: Mageia Reporter: Jeremiah Summers <JMiahMan>
Component: RPM PackagesAssignee: Neal Gompa <ngompa13>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: Normal CC: JMiahMan, marja11
Version: 6   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: mock-1.4.2-1.mga6.src.rpm CVE:
Status comment:
Attachments: patch for the issue

Description Jeremiah Summers 2017-10-06 22:48:01 CEST
Description of problem:
A new default has been added to mock to use nspawn, while this might be a awesome idea, it seems to be wreaking havoc on my ability to built Mageia packages in Docker. A Simple solution would be to turn it off. However I am not sure what it brings to the table, and maybe I'm just a corner case.


Version-Release number of selected component (if applicable):
mock-1.4.2-1

How reproducible:
Everytime

Steps to Reproduce:
1. Use mock in a Docker container
2. Try to rebuild src rpm.
Comment 1 Jeremiah Summers 2017-10-06 22:54:23 CEST
Created attachment 9704 [details]
patch for the issue

The simple solution is to just add:

"config_opts['use_nspawn'] = False"

to the mock files as presented in the example patch.

CC: (none) => JMiahMan

Marja Van Waes 2017-10-07 15:39:27 CEST

CC: (none) => marja11
Assignee: bugsquad => ngompa13

Comment 2 Neal Gompa 2017-10-07 15:52:40 CEST
Nspawn containers basically do the same thing Docker does, so if you're using mock in Docker, you will want to pass "--old-chroot" to the command to revert to using the chroot() instead, which should work inside of Docker.

Nspawn containers automatically namespace out everything, so you don't get collisions between different builds running at the same time, and it makes it far harder for host information to leak into the container and vice versa.

I do not intend to change the default, as upstream has intended for nspawn to be used to enhance the security of building packages.

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX

Comment 3 Jeremiah Summers 2017-10-07 16:52:00 CEST
That works, Thanks