mmornati / docker-mock-rpmbuilder Goto Github PK
View Code? Open in Web Editor NEWBuild RPMs using the Mock Project (for any platform)
License: GNU General Public License v2.0
Build RPMs using the Mock Project (for any platform)
License: GNU General Public License v2.0
For bulkier RPM's and build areas, /tmp is typically way too small for bulkier builds, such as gcc, and in high security environments it's mounted with "noexec" and "nosuid". Even if the software compiles, this can break test building.
Instead, use "/var/cache/docker-mock/" or some similarly specific directory.
I got an error building the container, due to a package conflict in epel-release.
You also do not need epel-release for the container, so I suggest removing it
Building works fine when I remove
RUN yum -y install epel-release
from the Dockerfile
I've been trying to create an rpm for the "duc" tool (http://duc.zevv.nl) using their rpm spec, this docker container, and running on jenkins. However, when running the following command:
docker run -t --rm \
--cap-add=SYS_ADMIN \
-e MOCK_CONFIG=epel-7-x86_64 \
-e GITHUB_WORKSPACE=/rpmbuild \
-e SOURCES=duc-1.4.4.tar.gz \
-e SPEC_FILE=duc.spec \
-v $(pwd):/rpmbuild
I get the following output:
=> Building parameters:
========================================================================
MOCK_CONFIG: epel-7-x86_64
SPEC_FILE: duc.spec
SOURCES: duc-1.4.4.tar.gz
OUTPUT_FOLDER: rpmbuild/output/epel-7-x86_64
MOCK_DEFINES:
========================================================================
sh: rpmbuild/output/epel-7-x86_64/script-test.sh: No such file or directory
However, I've found a way to work-around the issue is by omitting the GITHUB_WORKSPACE
variable, and prefixing the important path inputs, like so:
docker run -t --rm \
--cap-add=SYS_ADMIN \
-e MOCK_CONFIG=epel-7-x86_64 \
-e SOURCES=rpmbuild/duc-1.4.4.tar.gz \
-e SPEC_FILE=rpmbuild/duc.spec \
-v $(pwd):/rpmbuild
Once I do that, it appears to execute properly:
=> Building parameters:
========================================================================
MOCK_CONFIG: epel-7-x86_64
SPEC_FILE: rpmbuild/duc.spec
SOURCES: rpmbuild/duc-1.4.4.tar.gz
OUTPUT_FOLDER: /output/epel-7-x86_64
MOCK_DEFINES:
========================================================================
INFO: mock.py version 1.2.17 starting (python version = 2.7.5)...
Though I suspect I'm going to have to mount the /output directory in addition to the /rpmbuild dir.
$ sudo docker run -d -e MOCK_CONFIG=epel-6-i386 -e SOURCE_RPM=git-2.3.0-1.el7.centos.src.rpm -v /tmp/rpmbuild:/rpmbuild --privileged=true mmornati/mockrpmbuilder zsh: correct '/tmp/rpmbuild:/rpmbuild' to '/tmp/rpmbuild/rpmbuild' [nyae]? n Unable to find image 'mmornati/mockrpmbuilder:latest' locally Trying to pull repository docker.io/mmornati/mockrpmbuilder ... not found FATA[0007] Error: image mmornati/mockrpmbuilder:latest not found
Let me know if you need more details.
Thanks for a very useful Docker container. Hitting the following error
DEBUG util.py:468: Executing command: ['btrfs', 'subv', 'list', '/var/lib/mock'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'} and shell False
DEBUG util.py:393: ERROR: can't perform the search -Inappropriate ioctl for device
DEBUG util.py:393: ERROR: can't get rootid for '/var/lib/mock'
Might be related to running mock within a container, and to https://bugzilla.redhat.com/show_bug.cgi?id=1205564
I am seeing this in mock1.2.13. Can we do any workaround within the container to handle this gracefully.
Hi,
I tried to crossbuild for aarch64 on x86_64:
docker run --rm --privileged=true --volume=".:/rpmbuild" -w "/rpmbuild" \
--volume="/output:/rpmbuild/output" -e MOUNT_POINT="/rpmbuild" \
-e MOCK_CONFIG=fedora-rawhide-aarch64 -e SOURCES="monitoring-plugins-b784428.tar.gz" \
-e SPEC_FILE=monitoring-plugins-git.spec -e NETWORK="true" -e NO_CLEANUP="true" \
ghcr.io/waja/mock-rpmbuilder:latest
https://github.com/waja/docker-mock-rpmbuilder is just a fork, but with CI pipelines to generate and upload images to GHCR.
There are several error: failed to exec scriptlet interpreter /bin/sh: Exec format error
errors and finally the build fails with Error: call to /usr/sbin/ldconfig failed.nError: call to /usr/sbin/iconvconfig failed.nError: call to /usr/sbin/ldconfig failed.n
.
The full output can be found in the mock-builder.log.
Thanks Jan
Building the SRPM first with rpmbuild allows you to use a .spec file in a local git repo, and still have the speedup of building from an SRPM. The only time it really screws you up is if you're using one of those loathsome SuSE RPMs, that used to exclude patch files based on architecture.
See my setup at https://github.com/nkadel/samba-4.10.x-srpm
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.