Coder Social home page Coder Social logo

centos-mock-docker's Introduction

centos-mock-docker

An example of using Mock - FedoraProject on CentOS 7 to build RPMs. In this example, I rebuild a rpm of highway

Usage

Build the docker container.

docker build -t mock .

Start the container. The --cap-add=SYS_ADMIN option is needed to use mock command. Without this option, mock fails with the error ERROR: Namespace unshare failed.

docker run --cap-add=SYS_ADMIN -it mock

In the container, run the following commands.

su - mockbuild
./bin/build-highway.sh

The build results and logs are created in /var/lib/mock/epel-7-x86_64/result/

[mockbuild@7ea0955ef645 ~]$ ls -l /var/lib/mock/epel-7-x86_64/result/
total 1108
-rw-rw-r-- 1 mockbuild mock  31533 Dec  1 17:24 build.log
-rw-rw-r-- 1 mockbuild mock 314716 Dec  1 17:24 highway-1.1.0-1.el7.centos.src.rpm
-rw-rw-r-- 1 mockbuild mock 131272 Dec  1 17:24 highway-1.1.0-1.el7.centos.x86_64.rpm
-rw-rw-r-- 1 mockbuild mock 451168 Dec  1 17:24 highway-debuginfo-1.1.0-1.el7.centos.x86_64.rpm
-rw-rw-r-- 1 mockbuild mock 189962 Dec  1 17:24 root.log
-rw-rw-r-- 1 mockbuild mock    812 Dec  1 17:24 state.log

NOTE

It is preferrable to keep this container between building multiple RPMs since mock caches yum results. See Using Mock to test package builds - FedoraProject.

centos-mock-docker's People

Contributors

hnakamur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.