Giter Site home page Giter Site logo

pombredanne / dock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from containerbuildsystem/atomic-reactor

0.0 1.0 0.0 8.11 MB

Simple python library for building docker images.

License: BSD 3-Clause "New" or "Revised" License

Python 99.71% Shell 0.19% Dockerfile 0.06% Makefile 0.04%

dock's Introduction

Atomic Reactor

unittests status badge coveralls status badge lgtm python badge lgtm alerts badge linters status badge

Python library with command line interface for building docker images.

Features

  • Push image to registry when it's built
  • Build inside a docker container (so your builds are separated between each other)
  • git as a source to your Dockerfile (you may specify commit/branch and path to Dockerfile within the git repo)
  • Collect build logs
  • Integration with koji build system
  • Integration with fedora packaging system
  • Inject arbitrary yum repo inside Dockerfile (change source of your packages)
  • Retag base image so it matches FROM instruction in Dockerfile
  • Change base image (FROM) in your Dockerfile
  • Run simple tests after your image is built

Installation

From git

Clone this git repo and install Atomic Reactor using python installer:

git clone https://github.com/containerbuildsystem/atomic-reactor.git
cd atomic-reactor
pip install . --user

You don't even need to install it. You may use it straight from git:

export PYTHONPATH="${REACTOR_PATH}:${PYTHONPATH}"
alias atomic-reactor="python ${REACTOR_PATH}/atomic-reactor/cli/main.py"

Adding Dependencies

To add more Python dependencies, add them to the following files:

If you're wondering why you need to add dependencies to both files (setup.py and one of the requirements files), see install_requires vs requirements files.

To be able to build atomic-reactor with Cachito, we also need to keep the build requirements updated. Please follow Cachito pip build dependencies for updating build requirements. Please note that the resulting requirements will need to be pinned to older versions before moving to the next step to avoid installation issues with newer dependency versions.

Afterwards, pip-compile the dependencies via make pip-compile (you may need to run make venv first, unless the venv already exists).

Additionally, if any of the newly added dependencies in the generated requirements*.txt files need to be compiled from C code, please install any missing C libraries in the Dockerfile(s) as well as the test.sh script

Running tests

The prerequisite of running tests is to create a test environment container by test.sh. For example:

OS=fedora OS_VERSION=35 PYTHON_VERSION=3 ACTION=test ./test.sh

When the container is ready and running, you have choice to test your changes by executing pytest directly:

podman exec -it atomic-reactor-fedora-35-py3 python3 -m pytest tests/

or by tox:

podman exec -it atomic-reactor-fedora-35-py3 tox -e test

The tox.ini has defined several testenvs, use tox -l to check them.

Usage

If you would like to build your images within build containers, you need to obtain images for those containers. We call them build images. Atomic Reactor is installed inside and used to take care of build itself.

You can either get the build image from Dockerhub or create it yourself.

Further reading

dock's People

Contributors

ben-alkov avatar bfontecc007 avatar chmeliik avatar citizen-x avatar cverna avatar dependabot[bot] avatar dzickusrh avatar gbraad avatar goldmann avatar hjmodi avatar jarodwilson avatar jcajka avatar jpopelka avatar ktdreyer avatar lcarva avatar lkolacek avatar martinbasti avatar maxamillion avatar mkosiarc avatar mlangsdorf avatar mmilata avatar mprahl avatar owtaylor avatar rcerven avatar rwngwn avatar sosiouxme avatar tkdchen avatar tomastomecek avatar twaugh avatar vrutkovs avatar

Watchers

 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.