mmornati / docker-mock-rpmbuilder

Build RPMs using the Mock Project (for any platform)
GNU General Public License v2.0
62 stars 42 forks source link

Error while trying to run generated test script #19

Open Tzrlk opened 5 years ago

Tzrlk commented 5 years ago

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.

Tzrlk commented 5 years ago

I had a suspicion that is was permission related, but when I added a mount of $(pwd)/output:/output after the first mount, everything worked perfectly.