项目作者: cyphar

项目描述 :
Build OCI images from Dockerfiles.
高级语言: Python
项目地址: git://github.com/cyphar/orca-build.git
创建时间: 2017-04-04T17:59:47Z
项目社区:https://github.com/cyphar/orca-build

开源协议:GNU General Public License v3.0

下载


orca-build

orca-build allows you to build OCI images from a Dockerfile or Orcafile. It
doesn’t require a daemon or root privileges to operate. It is a fairly small
Python wrapper around the following projects (which are obviously requirements
to use orca-build):

This was a SUSE Hackweek project and is mainly intended to be a simple
tool for users that might want to create images as a rootless user, or to play
around with a simple PoC of how various OCI technologies can interact with each
other.

Usage

The usage is kinda like docker build. You provide it a build context that
contains a Dockerfile and orca-build does the rest. I plan to add support for
some more of the docker build flags in the near future, but at the moment it
works pretty well.

  1. usage: orca-build [-h] [--clean] [--gc] [--output OUTPUT] [--verbose]
  2. [--rootless] [--build-arg NAME=value] [-t TAGS]
  3. ctx
  4. Build an OCI image from a Dockerfile context. Rootless containers are also
  5. supported out-of-the-box.
  6. positional arguments:
  7. ctx Build context which is used when referencing host
  8. files. Files outside the build context cannot be
  9. accessed by the build script.
  10. optional arguments:
  11. -h, --help show this help message and exit
  12. --clean Remove all intermediate image tags after successful
  13. build.
  14. --gc Run a final garbage collection on output image.
  15. --output OUTPUT Path of OCI image to output to (if unspecified, a new
  16. image is created in /tmp).
  17. --verbose Output debugging information.
  18. --rootless Enable rootless containers mode.
  19. --build-arg NAME=value
  20. Build-time arguments used in conjunction with ARG.
  21. -t TAGS, --tag TAGS Tag(s) of the output image (by default, randomly
  22. generated).

Here’s an example session of building a standard Dockerfile:

  1. % orca-build -t some-tag .
  2. orca-build[INFO] BUILD[1 of 2]: from ['opensuse/amd64:42.2'] [json=False]
  3. orca-build[INFO] Created new image for build: /tmp/orca-build.r2xp0v8h
  4. ---> [skopeo]
  5. Getting image source signatures
  6. Copying blob sha256:ed6542b73fb1330e3eee8294a805b9a231e30b3efa71390f938ce89f210db860
  7. 47.09 MB / 47.09 MB [=========================================================]
  8. Copying config sha256:56fae18e2688b7d7caf2dd39960f0e6fda4383c174926e2ee47128f29de066cf
  9. 0 B / 805 B [-----------------------------------------------------------------]
  10. Writing manifest to image destination
  11. Storing signatures
  12. <--- [skopeo]
  13. orca-build[INFO] BUILD[2 of 2]: run ['echo', 'Hello orca-build!', '&&', 'cat', '/etc/os-release'] [json=False]
  14. ---> [umoci]
  15. <--- [umoci]
  16. ---> [runc]
  17. Hello orca-build!
  18. NAME="openSUSE Leap"
  19. VERSION="42.2"
  20. ID=opensuse
  21. ID_LIKE="suse"
  22. VERSION_ID="42.2"
  23. PRETTY_NAME="openSUSE Leap 42.2"
  24. ANSI_COLOR="0;32"
  25. CPE_NAME="cpe:/o:opensuse:leap:42.2"
  26. BUG_REPORT_URL="https://bugs.opensuse.org"
  27. HOME_URL="https://www.opensuse.org/"
  28. <--- [runc]
  29. ---> [umoci]
  30. <--- [umoci]
  31. orca-build[INFO] BUILD: finished
  32. ---> [umoci]
  33. <--- [umoci]
  34. orca-build[INFO] BUILD: created tags ['some-tag']

Installation

I don’t know how to do the whole “installation” thing with Python, so here’s
how you install orca-build. It only depends on the standard library (and
having the above tools in your $PATH).

  1. % sudo make install

If you want to make sure that umoci, skopeo and runc will play nicely
together, you can use make check. It will attempt to run through a trivial
usage of rootless containers with the tools above. If this fails, update your
installation accordingly. This tweaking should not be necessary in future
versions.

  1. % make check

I’ve only tested it with Python 3.6, but it should work with most modern Python
3 versions.

License

orca-build is licensed under the terms of the GPLv3 (or later).

  1. orca-build: container image builder
  2. Copyright (C) 2017 SUSE LLC
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses></http:>.