File container-build-checks-1723452932.412e7f6.obscpio of Package container-build-checks
07070100000000000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003200000000container-build-checks-1723452932.412e7f6/.github07070100000001000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003C00000000container-build-checks-1723452932.412e7f6/.github/workflows07070100000002000081A400000000000000000000000166B9CE040000030D000000000000000000000000000000000000004500000000container-build-checks-1723452932.412e7f6/.github/workflows/test.ymlname: Test + Lint
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-20.04
# Version in SLE 15
python: "3.6"
- os: ubuntu-latest
# Version in openSUSE Tumbleweed
python: "3.11"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install flake8
sudo apt update
sudo apt install -y podman
- name: Lint
run: make lint
- name: Test
run: make test
07070100000003000081A400000000000000000000000166B9CE040000002F000000000000000000000000000000000000003500000000container-build-checks-1723452932.412e7f6/.gitignoretests/*/built
tests/*/checks.new
tests/*/*.tar
07070100000004000081A400000000000000000000000166B9CE040000008C000000000000000000000000000000000000003600000000container-build-checks-1723452932.412e7f6/.gitpod.yml---
image:
file: Dockerfile
vscode:
extensions:
- ms-azuretools.vscode-docker
- ms-python.python
- ms-vscode.makefile-tools
07070100000005000081A400000000000000000000000166B9CE04000004FD000000000000000000000000000000000000003500000000container-build-checks-1723452932.412e7f6/DockerfileFROM registry.opensuse.org/opensuse/tumbleweed:latest
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3004
RUN zypper -n in system-group-wheel sudo make podman git jq sed python3 && zypper -n clean
### Gitpod user ###
# '-l': see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
# hadolint ignore=DL3004
RUN groupadd -g 33333 gitpod && \
useradd -l -u 33333 -g 33333 -G wheel -md /home/gitpod -s /bin/bash -p gitpod gitpod && \
# passwordless sudo for users in the 'wheel' group
echo "%wheel ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers.d/00-wheel-group-nopasswd
ENV HOME=/home/gitpod
WORKDIR $HOME
USER gitpod
# custom Bash prompt
RUN { echo && echo ". /etc/bash_completion.d/git-prompt.sh" && echo "PS1='\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1 \" (%s)\") $ '" ; } >> .bashrc
### Gitpod user (2) ###
# use sudo so that user does not get sudo usage info on (the first) login
# hadolint ignore=DL3004
RUN sudo echo "Running 'sudo' for Gitpod: success" && \
# create .bashrc.d folder and source it in the bashrc
mkdir -p /home/gitpod/.bashrc.d && \
(echo; echo "for i in \$(ls -A \$HOME/.bashrc.d/); do source \$HOME/.bashrc.d/\$i; done"; echo) >> /home/gitpod/.bashrc
07070100000006000081A400000000000000000000000166B9CE04000046AC000000000000000000000000000000000000003200000000container-build-checks-1723452932.412e7f6/LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
07070100000007000081A400000000000000000000000166B9CE04000009F1000000000000000000000000000000000000003300000000container-build-checks-1723452932.412e7f6/Makefile# Each recipe is a bash script
SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS = -ec
TESTFILES = $(wildcard tests/*/Dockerfile)
all: container-build-checks.py
install: container-build-checks.py
install -Dm0755 container-build-checks.py $(DESTDIR)/usr/lib/build/post-build-checks/container-build-checks
# Some test containers depend on other test containers. Make sure those are built first.
tests/broken-derived/built: tests/proper-base/built
tests/proper-derived/built: tests/proper-base/built
tests/oci-proper-derived/built: tests/oci-proper-base/built
tests/local-proper-derived/built: tests/proper-base/built
# Build the Dockerfile and create the tarball
tests/oci-%/built: tests/%/Dockerfile
@dir=$$(dirname $@)
pushd $$dir >/dev/null
testname=$$(basename $$dir)
echo Building OCI $$testname
# Build the container
podman build --squash -t "c-b-c-tests/$$testname" .
podman push "c-b-c-tests/$$testname" oci-archive:$$testname.tar
popd >/dev/null
touch $@
tests/%/built: tests/%/Dockerfile
@dir=$$(dirname $@)
pushd $$dir >/dev/null
testname=$$(basename $$dir)
echo Building $$testname
# Build the container
podman build --squash -t "c-b-c-tests/$$testname" .
podman save "c-b-c-tests/$$testname" > $$testname.tar
popd >/dev/null
touch $@
# Run c-b-c on the built image, compare output against checks.out
tests/%/tested: tests/%/built | all
@dir=$$(dirname $@)
testname=$$(basename $$dir)
export CBC_CONFIG_DIR=$$PWD/tests
pushd $$dir >/dev/null
echo "Testing $$testname"
ret=0
../../container-build-checks.py &>checks.new || ret=$$?
echo "Exited with $$ret" >>checks.new
popd >/dev/null
[ -e $${dir}/checks.out ] || >$${dir}/checks.out
diff -u $${dir}/checks.{out,new}
# Run c-b-c on the built image, save output as checks.out
tests/%/regen: tests/%/built | all
@dir=$$(dirname $@)
testname=$$(basename $$dir)
export CBC_CONFIG_DIR=$$PWD/tests
pushd $$dir >/dev/null
echo "Testing $$testname (regen)"
ret=0
../../container-build-checks.py &>checks.out || ret=$$?
echo "Exited with $$ret" >>checks.out
popd >/dev/null
lint: container-build-checks.py
flake8 $^ --max-line-length=120
clean:
rm -f tests/*/{built,*.tar,checks.new}
# Run all tests
test: $(subst /Dockerfile,/tested,$(TESTFILES))
# Run all tests, update checks.out
test-regen: $(subst /Dockerfile,/regen,$(TESTFILES))
.PRECIOUS: $(subst /Dockerfile,/built,$(TESTFILES))
.PHONY: clean install test
# For some reason, marking /tested as PHONY makes it a noop???
#.PHONY: clean install test $(subst /Dockerfile,/tested,$(TESTFILES))
07070100000008000081A400000000000000000000000166B9CE0400000EAB000000000000000000000000000000000000003400000000container-build-checks-1723452932.412e7f6/README.mdopenSUSE Container Build Checks 
===============================
This tool checks that built container images conform to the openSUSE container image policies (https://en.opensuse.org/Building_derived_containers).
It is designed to run at the end of image builds inside OBS, where it will look at all built images (both KIWI and DOCKER types) and fail the build if fatal issues were found. `make install` copies it to the directory where OBS expects it (https://github.com/openSUSE/obs-build/pull/675).
As input, it reads .containerinfo files generated by OBS, which contain information like the disturl, chosen tags and the name of the tarball in `docker save` format (other container tools are available). The latter contains `manifest.json`, the image config and layers.
To run it against built containers outside of OBS, it's necessary to craft a .containerinfo file containing the needed metainfo yourself, e.g.:
```
{
"disturl" : "obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container",
"file" : "proper-derived.tar",
"release" : "7.21",
"tags" : [
"opensuse/example:latest",
"opensuse/example:5.7",
"opensuse/example:5.7.7.21"
]
}
```
When called outside of OBS, it looks at all `*.containerinfo` files in the current directory.
Configuration
=============
Configuration files are in ini-format. All `*.conf` files in the configuration directory are read in alphabetical order. By default it looks for files in `/usr/share/container-build-checks/`, but the `CBC_CONFIG_DIR` environment variable can be used to override the path.
Available configuration options and their default values are:
```
[General]
# If true, treat all warnings as fatal. Errors are always fatal.
FatalWarnings=false
# If set, verify that the image-specific label prefix starts with this
Vendor=
# If set, verify that the org.opensuse.reference value uses this as registry
Registry=
[Tags]
# All tags have to match one of the patterns, e.g. opensuse/*,kubic/*
Allowed+=
# Tags must not match any of the patterns in here.
Blocked+=
```
Testing
=======
To build and run tests, run `make test` (parallel jobs are fine). If there are differences to the expected output, the diff will be shown and the test run fails.
Each subdirectory in `tests/` contains a `Dockerfile` used to build the tarball, a suitable `.containerinfo` with the metainformation and a `checks.out` file. The latter contains the expected output and exit status of running `container-build-checks.py` against that image.
Whenever the `Dockerfile` changes (tracked by the `built` stamp file), the image is rebuilt and the tarball updated. The image is tagged as `c-b-c-tests/<dirname>` and can be used as base image by other tests.
To update the `checks.out` files for all tests, run `make test-regen`.
`make lint` invokes `flake8` to perform linting on the source code.
Creating test cases
===================
To create a new test case, create a subdirectory in `tests/` and create or copy suitable `Dockerfile` and `*.containerinfo` files.
LABEL statements can be created from an existing image by running:
`podman image inspect foo | jq '.[0]["Config"]["Labels"]' | sed 's/": /=/g;s/^ "/LABEL /g;s/,$//g'`
Run `make test` (or just `make tests/foo/tested`) to see the output and `make test-regen` (or just `make tests/foo/regen`) to save it as `checks.out`.
Editing in Gitpod
==================
You can apply your edits directly from within your browser on [Gitpod](https://gitpod.io/#https://github.com/openSUSE/container-build-checks).07070100000009000081ED00000000000000000000000166B9CE040000335E000000000000000000000000000000000000004400000000container-build-checks-1723452932.412e7f6/container-build-checks.py#!/usr/bin/python3
# SPDX-FileCopyrightText: 2021,2024 SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later
from pathlib import Path
import configparser
import fnmatch
import glob
import json
import os
import re
import sys
import tarfile
class Image:
"""Information about the image to be tested."""
def __init__(self, containerinfo, tar):
self.containerinfo = containerinfo
self.tarfile = tar
if "oci-layout" in self.tarfile.getnames():
self.index = json.load(tar.extractfile("index.json"))
if len(self.index["manifests"]) != 1:
raise Exception("OCI index doesn't have exactly one entry")
manifest = "blobs/" + self.index["manifests"][0]["digest"].replace(":", "/")
self.manifest = json.load(tar.extractfile(manifest))
config = "blobs/" + self.manifest["config"]["digest"].replace(":", "/")
else:
self.manifest = json.load(tar.extractfile("manifest.json"))
if len(self.manifest) != 1:
raise Exception("Manifest doesn't have exactly one entry")
config = self.manifest[0]["Config"]
self.config = json.load(self.tarfile.extractfile(config))
self.is_local_build = "release" not in containerinfo and "disturl" not in containerinfo
class LabelInfo:
"""
Information about a given label/OCI annotation:
prefix: Prefix used by the "most derived" provider of the label,
usually the OCI annotation if available.
suffix: Suffix used by all providers of the label.
mandatory: Whether this label has to be set by at least one layer.
mandatory_derived: Whether this label has to be set by the top layer.
verifier: A function(image, result, value) passed the image and label content for verification
"""
def __init__(self, prefix, suffix, mandatory=True, mandatory_derived=True, verifier=None):
self.prefix = prefix
self.suffix = suffix
self.mandatory = mandatory
self.mandatory_derived = mandatory_derived
self.verifier = verifier
def oci(self):
return f"{self.prefix}.{self.suffix}"
def verify_disturl(image, result, value):
if "disturl" not in image.containerinfo and image.is_local_build:
result.hint("No disturl in containerinfo, local build?")
return
elif "disturl" not in image.containerinfo:
result.error("No disturl in containerinfo, but apparently not a local build.")
return
if value != image.containerinfo["disturl"]:
result.error("org.openbuildservice.disturl not set correctly, bug in OBS?")
# Split a reference (e.g. registry.opensuse.org/foo/bar:tag01) into (registry, repo, tag)
REFERENCE_RE = re.compile("([^/]+)/([^:]+):([^:]+)")
# Search for substitution patterns like %FOO% in label values
LABEL_SUB_RE = re.compile("%([A-Za-z0-9_]+)%")
def verify_reference(image, result, value):
reference_match = REFERENCE_RE.fullmatch(value)
if reference_match is None:
result.error(f"The value of the org.opensuse.reference label ({value}) is invalid")
return
(registry, repo, tag) = reference_match.groups()
allowed_registries: list[str] = config["General"].getlist("Registry")
if len(allowed_registries) and registry not in allowed_registries:
result.warn(
f"The org.opensuse.reference label ({value}) does not use an "
f"allowed registry: {','.join(allowed_registries)}")
if f"{repo}:{tag}" not in image.containerinfo["tags"]:
tags = ", ".join(image.containerinfo["tags"])
result.warn(f"The org.opensuse.reference label ({value}) does not refer to an existing tag ({tags})")
elif "release" in image.containerinfo and image.containerinfo["release"] not in tag:
result.warn(f"The org.opensuse.reference label ({value}) does not refer "
f"to a tag identifying a specific build")
LABEL_INFO = [
LabelInfo("org.openbuildservice", "disturl", verifier=verify_disturl),
LabelInfo("org.opencontainers.image", "title"),
LabelInfo("org.opencontainers.image", "description"),
LabelInfo("org.opencontainers.image", "version"),
LabelInfo("org.opencontainers.image", "created"),
LabelInfo("org.opencontainers.image", "vendor", mandatory_derived=False),
LabelInfo("org.opencontainers.image", "url", mandatory_derived=False),
LabelInfo("org.opensuse", "reference", verifier=verify_reference),
]
class CheckResult:
"""Class to track count of issues"""
def __init__(self):
self.hints = 0
self.warnings = 0
self.errors = 0
def hint(self, msg):
print(f"Hint: {msg}")
self.hints += 1
def warn(self, msg):
print(f"Warning: {msg}")
self.warnings += 1
def error(self, msg):
print(f"Error: {msg}")
self.errors += 1
def containerinfos():
"""Return a list of .containerinfo files to check."""
if "BUILD_ROOT" not in os.environ:
# Not running in an OBS build container
return glob.glob("*.containerinfo")
# Running in an OBS build container
buildroot = os.environ["BUILD_ROOT"]
topdir = "/usr/src/packages"
if os.path.isdir(buildroot + "/.build.packages"):
topdir = "/.build.packages"
if os.path.islink(buildroot + "/.build.packages"):
topdir = "/" + os.readlink(buildroot + "/.build.packages")
return (glob.glob(f"{buildroot}{topdir}/DOCKER/*.containerinfo")
+ glob.glob(f"{buildroot}{topdir}/KIWI/*.containerinfo"))
def check_labels(image, result):
"""Verify labels and their content"""
labels = image.config.get("config", {}).get("Labels", {})
# Treat this specially, it is usually not set manually
if "org.openbuildservice.disturl" not in labels:
result.error("org.openbuildservice.disturl not set correctly, bug in OBS?")
# Reject labels like "something-%foo%" or "%foo%-something"
for (label_name, label_value) in labels.items():
if LABEL_SUB_RE.search(label_value):
result.error(f"Label {label_name} = {label_value} appears to be missing substitution?")
# Get the image specific label prefix by looking at the .reference
labelprefix = None
if "org.opensuse.reference" in labels:
reference = labels["org.opensuse.reference"]
reference_labels = [name for (name, value) in labels.items() if value == reference]
reference_labels = [name for name in reference_labels
if name != "org.opensuse.reference" and name.endswith(".reference")]
if len(reference_labels) == 0:
result.warn("Could not find prefixed copy of the org.opensuse.reference label")
elif len(reference_labels) > 1:
result.warn(f"Unable to find which of those labels is the one corresponding "
f"to this image: {reference_labels}")
else:
labelprefix = reference_labels[0][0:-len(".reference")]
if not labelprefix:
result.warn("Could not determine image specific label prefix, some checks will be skipped.")
else:
print(f"Detected image specific label prefix: {labelprefix}")
if config["General"]["Vendor"] and not labelprefix.startswith(f"{config['General']['Vendor']}."):
result.warn(f"Label prefix doesn't start with {config['General']['Vendor']}")
for labelinfo in LABEL_INFO:
# Are all mandatory labels present?
if labelinfo.mandatory and labelinfo.oci() not in labels:
result.warn(f"Label {labelinfo.oci()} is not set by the image or any of its bases")
continue
if labelinfo.oci() in labels and labelinfo.verifier:
labelinfo.verifier(image, result, labels[labelinfo.oci()])
# Check prefixed labels
if labelprefix:
if f"{labelprefix}.{labelinfo.suffix}" in labels:
if labelinfo.oci() not in labels:
result.warn(f"Label {labelprefix}.{labelinfo.suffix} set but not {labelinfo.oci()}")
elif labels[labelinfo.oci()] != labels[f"{labelprefix}.{labelinfo.suffix}"]:
result.warn(f"Label {labelprefix}.{labelinfo.suffix} not identical to {labelinfo.oci()}")
elif labelinfo.mandatory_derived:
result.warn(f"Labels {labelinfo.oci()} and {labelprefix}.{labelinfo.suffix} "
f"not specified by this image")
def match_patterns(needle, patterns):
"""Runs fnmatch.fnmatchcase against each pattern in patterns and returns
the first pattern which matches."""
for pattern in patterns:
if fnmatch.fnmatchcase(needle, pattern):
return pattern
def check_image(image, result):
"""Perform checks on the given image"""
if image.is_local_build:
result.hint("No release and disturl found in containerinfo, probably a local osc build. "
"Further analysis might be misleading.")
# No manually defined repos which could escape the defined paths in e.g. openSUSE:Factory
if "repos" in image.containerinfo and image.containerinfo["repos"] != [{"url": "obsrepositories:/"}]:
urls = ", ".join([repo["url"] for repo in image.containerinfo["repos"]])
result.warn(f"Using manually defined repositories ({urls}) in the image. Only obsrepositories:/ is allowed.")
# Make sure tags are namespaced and one of them contains the release
if "release" in image.containerinfo:
print(f"Release: {image.containerinfo['release']}")
elif not image.is_local_build:
result.error("No release in containerinfo, but apparently not a local build.")
releasetagfound = False
allowed_tags = config["Tags"].getlist("Allowed")
blocked_tags = config["Tags"].getlist("Blocked")
for tag in image.containerinfo["tags"]:
print(f"Tag: {tag}")
if allowed_tags and not match_patterns(tag, allowed_tags):
result.warn(f"Tag {tag} is not allowed. Allowed patterns: {', '.join(allowed_tags)}.")
blocked_pattern = match_patterns(tag, blocked_tags)
if blocked_pattern is not None:
result.warn(f"Tag {tag} is not allowed (blocked by {blocked_pattern}).")
if "release" in image.containerinfo and image.containerinfo["release"] in tag:
releasetagfound = True
if not releasetagfound and not image.is_local_build:
result.warn("None of the tags are unique to a specific build of the image.\n" +
"Make sure that at least one tag contains the release.")
check_labels(image, result)
class AppendInterpolation(configparser.Interpolation):
"""Allow key+=value syntax to append ,-delimited values.
Use with converters={"list": lambda x: x.split(",")} to allow
config.getlist("foo")."""
def before_read(self, parser, section, option, value):
if option.endswith("+"):
key = option[:-1]
if key in parser[section] and parser[section][key]:
current = parser[section][key]
# configparser might not be done flattening it
if isinstance(current, list):
current = ",".join(current)
# This may be called multiple times for the same value,
# so drop duplicate elements.
value = ",".join(sorted(set(current.split(",") + value.split(","))))
parser.set(section, key, value)
return value
result = CheckResult()
# Load the configuration
configdir = os.environ.get("CBC_CONFIG_DIR", "/usr/share/container-build-checks/")
config = configparser.RawConfigParser(interpolation=AppendInterpolation(),
converters={"list": lambda x: list(filter(None, x.split(",")))})
config.read_dict({"General": {"FatalWarnings": False, "Vendor": "", "Registry": ""},
"Tags": {"Allowed": "", "Blocked": ""}})
config.read(sorted(glob.iglob(glob.escape(configdir) + "/*.conf")))
if not config["General"]["Vendor"]:
result.warn("No Vendor defined in the configuration")
if not config["General"]["Registry"]:
result.hint("No Registry defined in the configuration")
# Do checks
for containerinfo in containerinfos():
print(f"Looking at {containerinfo}")
with open(containerinfo, "rb") as cifile:
ci_dict = json.load(cifile)
# Open the tarball and look inside
with tarfile.open(Path(containerinfo).resolve().parent / ci_dict['file']) as tar:
image = Image(ci_dict, tar)
check_image(image, result)
print()
# Checking done, show a summary and exit
ret = 0
print(f"container-build-checks done. Hints: {result.hints} Warnings: {result.warnings} Errors: {result.errors}")
if result.warnings > 0:
if config["General"].getboolean("FatalWarnings"):
print("Treating warnings as fatal due to project configuration.")
ret = 1
else:
print("Warnings found, but those are only fatal in certain projects.")
if result.errors > 0:
print("Fatal errors found.")
ret = 1
sys.exit(ret)
0707010000000A000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003000000000container-build-checks-1723452932.412e7f6/tests0707010000000B000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003C00000000container-build-checks-1723452932.412e7f6/tests/broken-base0707010000000C000081A400000000000000000000000166B9CE04000002A0000000000000000000000000000000000000004700000000container-build-checks-1723452932.412e7f6/tests/broken-base/DockerfileFROM scratch
LABEL org.openbuildservice.disturl="not obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker"
LABEL org.opencontainers.image.created="invalid 2021-05-20T00:23:03.624005870Z"
LABEL org.opencontainers.image.description="Not an image containing a minimal environment for containers based on openSUSE Tumbleweed."
LABEL org.opencontainers.image.title="Not openSUSE Tumbleweed Base Container"
LABEL org.opencontainers.image.url="not a url"
LABEL org.opencontainers.image.version="20210519"
LABEL org.opensuse.reference="notregistry.opensuse.org/opensuse/nottumbleweed:latest"
COPY some-file /some-file
0707010000000D000081A400000000000000000000000166B9CE0400000279000000000000000000000000000000000000005600000000container-build-checks-1723452932.412e7f6/tests/broken-base/broken-base.containerinfo{
"buildtime" : 1621470206,
"disturl" : "obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker",
"file" : "broken-base.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"name" : "opensuse-tumbleweed-image",
"release" : "14.19",
"repos" : [
{
"url" : "obsrepositories:/"
},
{
"url" : "obs://devel:evil/"
}
],
"tags" : [
"opensuse/tumbleweed:latest",
"opensuse/tumbleweed:20210519"
],
"version" : "1.0.4"
}
0707010000000E000081A400000000000000000000000166B9CE04000004C4000000000000000000000000000000000000004700000000container-build-checks-1723452932.412e7f6/tests/broken-base/checks.outLooking at broken-base.containerinfo
Warning: Using manually defined repositories (obsrepositories:/, obs://devel:evil/) in the image. Only obsrepositories:/ is allowed.
Release: 14.19
Tag: opensuse/tumbleweed:latest
Tag: opensuse/tumbleweed:20210519
Warning: None of the tags are unique to a specific build of the image.
Make sure that at least one tag contains the release.
Warning: Could not find prefixed copy of the org.opensuse.reference label
Warning: Could not determine image specific label prefix, some checks will be skipped.
Error: org.openbuildservice.disturl not set correctly, bug in OBS?
Warning: Label org.opencontainers.image.vendor is not set by the image or any of its bases
Warning: The org.opensuse.reference label (notregistry.opensuse.org/opensuse/nottumbleweed:latest) does not use an allowed registry: registry.example.com,registry.opensuse.org
Warning: The org.opensuse.reference label (notregistry.opensuse.org/opensuse/nottumbleweed:latest) does not refer to an existing tag (opensuse/tumbleweed:latest, opensuse/tumbleweed:20210519)
container-build-checks done. Hints: 0 Warnings: 7 Errors: 1
Warnings found, but those are only fatal in certain projects.
Fatal errors found.
Exited with 1
0707010000000F000081A400000000000000000000000166B9CE0400000004000000000000000000000000000000000000004600000000container-build-checks-1723452932.412e7f6/tests/broken-base/some-fileHi!
07070100000010000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003F00000000container-build-checks-1723452932.412e7f6/tests/broken-derived07070100000011000081A400000000000000000000000166B9CE04000002FC000000000000000000000000000000000000004A00000000container-build-checks-1723452932.412e7f6/tests/broken-derived/DockerfileFROM c-b-c-tests/proper-base
LABEL org.openbuildservice.disturl="obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container"
LABEL org.opencontainers.image.created="2021-05-21T14:28:22.338350130Z"
LABEL org.opencontainers.image.description="This contains nano 5.7"
LABEL org.opencontainers.image.title="Example container"
LABEL org.opencontainers.image.version="5.7"
LABEL com.opensuse.example.created="2021-05-21T14:28:22.338350130Z"
LABEL com.opensuse.example.description="This does not contain nano 5.7"
LABEL com.opensuse.example.reference="registry.opensuse.org/opensuse/example:5.7"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/example:5.7"
COPY some-file /some-file
07070100000012000081A400000000000000000000000166B9CE0400000262000000000000000000000000000000000000005C00000000container-build-checks-1723452932.412e7f6/tests/broken-derived/broken-derived.containerinfo{
"buildtime" : 1621607310,
"disturl" : "obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container",
"file" : "broken-derived.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09",
"release" : "7.21",
"repos" : [
{
"url" : "not obsrepositories:/"
}
],
"tags" : [
"naughty:latest",
"notallowed/either:latest",
"opensuse/example:5.7",
"opensuse/example:5.7.7.21"
],
"version" : "5.7"
}
07070100000013000081A400000000000000000000000166B9CE0400000538000000000000000000000000000000000000004A00000000container-build-checks-1723452932.412e7f6/tests/broken-derived/checks.outLooking at broken-derived.containerinfo
Warning: Using manually defined repositories (not obsrepositories:/) in the image. Only obsrepositories:/ is allowed.
Release: 7.21
Tag: naughty:latest
Warning: Tag naughty:latest is not allowed. Allowed patterns: kubic/*, opensuse/*.
Warning: Tag naughty:latest is not allowed (blocked by naughty*).
Tag: notallowed/either:latest
Warning: Tag notallowed/either:latest is not allowed. Allowed patterns: kubic/*, opensuse/*.
Tag: opensuse/example:5.7
Tag: opensuse/example:5.7.7.21
Detected image specific label prefix: com.opensuse.example
Warning: Label prefix doesn't start with org.opensuse
Warning: Labels org.openbuildservice.disturl and com.opensuse.example.disturl not specified by this image
Warning: Labels org.opencontainers.image.title and com.opensuse.example.title not specified by this image
Warning: Label com.opensuse.example.description not identical to org.opencontainers.image.description
Warning: Labels org.opencontainers.image.version and com.opensuse.example.version not specified by this image
Warning: The org.opensuse.reference label (registry.opensuse.org/opensuse/example:5.7) does not refer to a tag identifying a specific build
container-build-checks done. Hints: 0 Warnings: 10 Errors: 0
Warnings found, but those are only fatal in certain projects.
Exited with 0
07070100000014000081A400000000000000000000000166B9CE040000000F000000000000000000000000000000000000004900000000container-build-checks-1723452932.412e7f6/tests/broken-derived/some-fileThis is a bug!
07070100000015000081A400000000000000000000000166B9CE040000008A000000000000000000000000000000000000003C00000000container-build-checks-1723452932.412e7f6/tests/checks.conf[General]
Vendor=org.opensuse
Registry=registry.opensuse.org
Registry+=registry.example.com
[Tags]
Allowed+=opensuse/*
Blocked+=naughty*
07070100000016000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003600000000container-build-checks-1723452932.412e7f6/tests/empty07070100000017000081A400000000000000000000000166B9CE040000000D000000000000000000000000000000000000004100000000container-build-checks-1723452932.412e7f6/tests/empty/DockerfileFROM scratch
07070100000018000081A400000000000000000000000166B9CE04000004B1000000000000000000000000000000000000004100000000container-build-checks-1723452932.412e7f6/tests/empty/checks.outLooking at empty.containerinfo
Release: 42.0
Warning: None of the tags are unique to a specific build of the image.
Make sure that at least one tag contains the release.
Error: org.openbuildservice.disturl not set correctly, bug in OBS?
Warning: Could not determine image specific label prefix, some checks will be skipped.
Warning: Label org.openbuildservice.disturl is not set by the image or any of its bases
Warning: Label org.opencontainers.image.title is not set by the image or any of its bases
Warning: Label org.opencontainers.image.description is not set by the image or any of its bases
Warning: Label org.opencontainers.image.version is not set by the image or any of its bases
Warning: Label org.opencontainers.image.created is not set by the image or any of its bases
Warning: Label org.opencontainers.image.vendor is not set by the image or any of its bases
Warning: Label org.opencontainers.image.url is not set by the image or any of its bases
Warning: Label org.opensuse.reference is not set by the image or any of its bases
container-build-checks done. Hints: 0 Warnings: 10 Errors: 1
Warnings found, but those are only fatal in certain projects.
Fatal errors found.
Exited with 1
07070100000019000081A400000000000000000000000166B9CE04000001DB000000000000000000000000000000000000004A00000000container-build-checks-1723452932.412e7f6/tests/empty/empty.containerinfo{
"buildtime" : 1621470206,
"disturl" : "obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker",
"file" : "empty.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"name" : "empty",
"release" : "42.0",
"repos" : [
{
"url" : "obsrepositories:/"
}
],
"tags" : [],
"version" : "1.0.4"
}
0707010000001A000081A400000000000000000000000166B9CE0400000018000000000000000000000000000000000000003B00000000container-build-checks-1723452932.412e7f6/tests/kubic.conf[Tags]
Allowed+=kubic/*
0707010000001B000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003D00000000container-build-checks-1723452932.412e7f6/tests/label-checks0707010000001C000081A400000000000000000000000166B9CE040000052F000000000000000000000000000000000000004800000000container-build-checks-1723452932.412e7f6/tests/label-checks/DockerfileFROM scratch
LABEL org.openbuildservice.disturl="obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker"
LABEL org.opencontainers.image.created="2021-05-20T00:23:03.624005870Z"
LABEL org.opencontainers.image.description="Image that is 100% based on openSUSE Tumbleweed."
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Base Container"
LABEL org.opencontainers.image.url="https://www.opensuse.org/"
LABEL org.opencontainers.image.vendor="openSUSE Project"
LABEL org.opencontainers.image.version="20210519.%RELEASETYPO%"
LABEL org.opensuse.base.created="2021-05-20T00:23:03.624005870Z"
LABEL org.opensuse.base.description="Image that is 100% based on openSUSE Tumbleweed."
LABEL org.opensuse.base.disturl="obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker"
LABEL org.opensuse.base.reference="registry.opensuse.org/opensuse/tumbleweed:20210519.14.19"
LABEL org.opensuse.base.title="openSUSE Tumbleweed Base Container"
LABEL org.opensuse.base.url="https://www.opensuse.org/"
LABEL org.opensuse.base.vendor="openSUSE Project"
LABEL org.opensuse.base.version="20210519.%RELEASETYPO%"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/tumbleweed:20210519.14.19"
COPY some-file /some-file
0707010000001D000081A400000000000000000000000166B9CE0400000205000000000000000000000000000000000000004800000000container-build-checks-1723452932.412e7f6/tests/label-checks/checks.outLooking at label-checks.containerinfo
Release: 14.19
Tag: opensuse/tumbleweed:latest
Tag: opensuse/tumbleweed:20210519
Tag: opensuse/tumbleweed:20210519.14.19
Error: Label org.opencontainers.image.version = 20210519.%RELEASETYPO% appears to be missing substitution?
Error: Label org.opensuse.base.version = 20210519.%RELEASETYPO% appears to be missing substitution?
Detected image specific label prefix: org.opensuse.base
container-build-checks done. Hints: 0 Warnings: 0 Errors: 2
Fatal errors found.
Exited with 1
0707010000001E000081A400000000000000000000000166B9CE0400000533000000000000000000000000000000000000005800000000container-build-checks-1723452932.412e7f6/tests/label-checks/label-checks.containerinfo{
"buildtime" : 1621470206,
"disturl" : "obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker",
"file" : "label-checks.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"name" : "opensuse-tumbleweed-image",
"release" : "14.19",
"repos" : [
{
"url" : "obsrepositories:/"
}
],
"tags" : [
"opensuse/tumbleweed:latest",
"opensuse/tumbleweed:20210519",
"opensuse/tumbleweed:20210519.14.19"
],
"tar_blobids" : [
"sha256:11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"sha256:89a8c2a08e572bfd8ef8eb05648638443f0d50e4c9e9913f01adbeb2e89ec9cd"
],
"tar_manifest" : "[{\"Config\":\"sha256:11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78\",\"RepoTags\":[\"opensuse/tumbleweed:latest\",\"opensuse/tumbleweed:20210519\",\"opensuse/tumbleweed:20210519.14.19\"],\"Layers\":[\"sha256:89a8c2a08e572bfd8ef8eb05648638443f0d50e4c9e9913f01adbeb2e89ec9cd\"]}]",
"tar_md5sum" : "eb472571d516e44c1c05dc73a47f61e7",
"tar_mtime" : 1621470212,
"tar_sha256sum" : "7e8b9aaad5222b8680f17ffcf4c7f514783d86e3193b7f925c066a14113080de",
"tar_size" : 36567552,
"version" : "1.0.4"
}
0707010000001F000081A400000000000000000000000166B9CE0400000004000000000000000000000000000000000000004700000000container-build-checks-1723452932.412e7f6/tests/label-checks/some-fileHi!
07070100000020000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000004500000000container-build-checks-1723452932.412e7f6/tests/local-proper-derived07070100000021000081A400000000000000000000000166B9CE0400000429000000000000000000000000000000000000005000000000container-build-checks-1723452932.412e7f6/tests/local-proper-derived/DockerfileFROM c-b-c-tests/proper-base
LABEL io.buildah.version="1.20.1"
LABEL org.openbuildservice.disturl="obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container"
LABEL org.opencontainers.image.created="2021-05-21T14:28:22.338350130Z"
LABEL org.opencontainers.image.description="This contains nano 5.7"
LABEL org.opencontainers.image.title="Example container"
LABEL org.opencontainers.image.version="5.7"
LABEL org.opensuse.example.created="2021-05-21T14:28:22.338350130Z"
LABEL org.opensuse.example.description="This contains nano 5.7"
LABEL org.opensuse.example.disturl="obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container"
LABEL org.opensuse.example.reference="registry.opensuse.org/opensuse/example:5.7.7.21"
LABEL org.opensuse.example.title="Example container"
LABEL org.opensuse.example.version="5.7"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/example:5.7.7.21"
COPY some-file /some-file
07070100000022000081A400000000000000000000000166B9CE04000001CB000000000000000000000000000000000000005000000000container-build-checks-1723452932.412e7f6/tests/local-proper-derived/checks.outLooking at local-proper-derived.containerinfo
Hint: No release and disturl found in containerinfo, probably a local osc build. Further analysis might be misleading.
Tag: opensuse/example:latest
Tag: opensuse/example:5.7
Tag: opensuse/example:5.7.7.21
Tag: kubic/testtag:latest
Detected image specific label prefix: org.opensuse.example
Hint: No disturl in containerinfo, local build?
container-build-checks done. Hints: 2 Warnings: 0 Errors: 0
Exited with 0
07070100000023000081A400000000000000000000000166B9CE0400000506000000000000000000000000000000000000006800000000container-build-checks-1723452932.412e7f6/tests/local-proper-derived/local-proper-derived.containerinfo{
"buildtime" : 1621607310,
"file" : "local-proper-derived.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09",
"repos" : [
{
"url" : "obsrepositories:/"
}
],
"tags" : [
"opensuse/example:latest",
"opensuse/example:5.7",
"opensuse/example:5.7.7.21",
"kubic/testtag:latest"
],
"tar_blobids" : [
"sha256:43e763c1a9ac8eaa809d77c4ad0c543d78a826ba9d811eae19624c31e799fd1c",
"sha256:a0ea0ce79dfa175149b9f715342e13a9472ee6bfaeccfd4ecc6827f2494aef18",
"sha256:df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09"
],
"tar_manifest" : "[{\"Config\":\"sha256:df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09\",\"RepoTags\":[\"opensuse/example:latest\",\"opensuse/example:5.7\",\"opensuse/example:5.7.7.21\"],\"Layers\":[\"sha256:a0ea0ce79dfa175149b9f715342e13a9472ee6bfaeccfd4ecc6827f2494aef18\",\"sha256:43e763c1a9ac8eaa809d77c4ad0c543d78a826ba9d811eae19624c31e799fd1c\"]}]",
"tar_md5sum" : "72c8bfea4f24b5954cea7b788093e25c",
"tar_mtime" : 1621607315,
"tar_sha256sum" : "ee6344740bd7c23a9e4b9f2b5ff031b95566a0a7613ff082ed3a856a5559e297",
"tar_size" : 40647680,
"version" : "5.7"
}
07070100000024000081A400000000000000000000000166B9CE0400000004000000000000000000000000000000000000004F00000000container-build-checks-1723452932.412e7f6/tests/local-proper-derived/some-fileHi!
07070100000025000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000004000000000container-build-checks-1723452932.412e7f6/tests/oci-proper-base07070100000026000081A400000000000000000000000166B9CE0400000565000000000000000000000000000000000000004B00000000container-build-checks-1723452932.412e7f6/tests/oci-proper-base/DockerfileFROM scratch
LABEL org.openbuildservice.disturl="obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker"
LABEL org.opencontainers.image.created="2021-05-20T00:23:03.624005870Z"
LABEL org.opencontainers.image.description="Image containing a minimal environment for containers based on openSUSE Tumbleweed."
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Base Container"
LABEL org.opencontainers.image.url="https://www.opensuse.org/"
LABEL org.opencontainers.image.vendor="openSUSE Project"
LABEL org.opencontainers.image.version="20210519.14.19"
LABEL org.opensuse.base.created="2021-05-20T00:23:03.624005870Z"
LABEL org.opensuse.base.description="Image containing a minimal environment for containers based on openSUSE Tumbleweed."
LABEL org.opensuse.base.disturl="obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker"
LABEL org.opensuse.base.reference="registry.opensuse.org/opensuse/tumbleweed:20210519.14.19"
LABEL org.opensuse.base.title="openSUSE Tumbleweed Base Container"
LABEL org.opensuse.base.url="https://www.opensuse.org/"
LABEL org.opensuse.base.vendor="openSUSE Project"
LABEL org.opensuse.base.version="20210519.14.19"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/tumbleweed:20210519.14.19"
COPY some-file /some-file
07070100000027000081A400000000000000000000000166B9CE0400000125000000000000000000000000000000000000004B00000000container-build-checks-1723452932.412e7f6/tests/oci-proper-base/checks.outLooking at oci-proper-base.containerinfo
Release: 14.19
Tag: opensuse/tumbleweed:latest
Tag: opensuse/tumbleweed:20210519
Tag: opensuse/tumbleweed:20210519.14.19
Detected image specific label prefix: org.opensuse.base
container-build-checks done. Hints: 0 Warnings: 0 Errors: 0
Exited with 0
07070100000028000081A400000000000000000000000166B9CE0400000536000000000000000000000000000000000000005E00000000container-build-checks-1723452932.412e7f6/tests/oci-proper-base/oci-proper-base.containerinfo{
"buildtime" : 1621470206,
"disturl" : "obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker",
"file" : "oci-proper-base.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"name" : "opensuse-tumbleweed-image",
"release" : "14.19",
"repos" : [
{
"url" : "obsrepositories:/"
}
],
"tags" : [
"opensuse/tumbleweed:latest",
"opensuse/tumbleweed:20210519",
"opensuse/tumbleweed:20210519.14.19"
],
"tar_blobids" : [
"sha256:11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"sha256:89a8c2a08e572bfd8ef8eb05648638443f0d50e4c9e9913f01adbeb2e89ec9cd"
],
"tar_manifest" : "[{\"Config\":\"sha256:11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78\",\"RepoTags\":[\"opensuse/tumbleweed:latest\",\"opensuse/tumbleweed:20210519\",\"opensuse/tumbleweed:20210519.14.19\"],\"Layers\":[\"sha256:89a8c2a08e572bfd8ef8eb05648638443f0d50e4c9e9913f01adbeb2e89ec9cd\"]}]",
"tar_md5sum" : "eb472571d516e44c1c05dc73a47f61e7",
"tar_mtime" : 1621470212,
"tar_sha256sum" : "7e8b9aaad5222b8680f17ffcf4c7f514783d86e3193b7f925c066a14113080de",
"tar_size" : 36567552,
"version" : "1.0.4"
}
07070100000029000081A400000000000000000000000166B9CE0400000004000000000000000000000000000000000000004A00000000container-build-checks-1723452932.412e7f6/tests/oci-proper-base/some-fileHi!
0707010000002A000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000004300000000container-build-checks-1723452932.412e7f6/tests/oci-proper-derived0707010000002B000081A400000000000000000000000166B9CE040000042D000000000000000000000000000000000000004E00000000container-build-checks-1723452932.412e7f6/tests/oci-proper-derived/DockerfileFROM c-b-c-tests/oci-proper-base
LABEL io.buildah.version="1.20.1"
LABEL org.openbuildservice.disturl="obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container"
LABEL org.opencontainers.image.created="2021-05-21T14:28:22.338350130Z"
LABEL org.opencontainers.image.description="This contains nano 5.7"
LABEL org.opencontainers.image.title="Example container"
LABEL org.opencontainers.image.version="5.7"
LABEL org.opensuse.example.created="2021-05-21T14:28:22.338350130Z"
LABEL org.opensuse.example.description="This contains nano 5.7"
LABEL org.opensuse.example.disturl="obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container"
LABEL org.opensuse.example.reference="registry.opensuse.org/opensuse/example:5.7.7.21"
LABEL org.opensuse.example.title="Example container"
LABEL org.opensuse.example.version="5.7"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/example:5.7.7.21"
COPY some-file /some-file
0707010000002C000081A400000000000000000000000166B9CE0400000130000000000000000000000000000000000000004E00000000container-build-checks-1723452932.412e7f6/tests/oci-proper-derived/checks.outLooking at oci-proper-derived.containerinfo
Release: 7.21
Tag: opensuse/example:latest
Tag: opensuse/example:5.7
Tag: opensuse/example:5.7.7.21
Tag: kubic/testtag:latest
Detected image specific label prefix: org.opensuse.example
container-build-checks done. Hints: 0 Warnings: 0 Errors: 0
Exited with 0
0707010000002D000081A400000000000000000000000166B9CE04000005B3000000000000000000000000000000000000006400000000container-build-checks-1723452932.412e7f6/tests/oci-proper-derived/oci-proper-derived.containerinfo{
"buildtime" : 1621607310,
"disturl" : "obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container",
"file" : "oci-proper-derived.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09",
"release" : "7.21",
"repos" : [
{
"url" : "obsrepositories:/"
}
],
"tags" : [
"opensuse/example:latest",
"opensuse/example:5.7",
"opensuse/example:5.7.7.21",
"kubic/testtag:latest"
],
"tar_blobids" : [
"sha256:43e763c1a9ac8eaa809d77c4ad0c543d78a826ba9d811eae19624c31e799fd1c",
"sha256:a0ea0ce79dfa175149b9f715342e13a9472ee6bfaeccfd4ecc6827f2494aef18",
"sha256:df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09"
],
"tar_manifest" : "[{\"Config\":\"sha256:df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09\",\"RepoTags\":[\"opensuse/example:latest\",\"opensuse/example:5.7\",\"opensuse/example:5.7.7.21\"],\"Layers\":[\"sha256:a0ea0ce79dfa175149b9f715342e13a9472ee6bfaeccfd4ecc6827f2494aef18\",\"sha256:43e763c1a9ac8eaa809d77c4ad0c543d78a826ba9d811eae19624c31e799fd1c\"]}]",
"tar_md5sum" : "72c8bfea4f24b5954cea7b788093e25c",
"tar_mtime" : 1621607315,
"tar_sha256sum" : "ee6344740bd7c23a9e4b9f2b5ff031b95566a0a7613ff082ed3a856a5559e297",
"tar_size" : 40647680,
"version" : "5.7"
}
0707010000002E000081A400000000000000000000000166B9CE0400000004000000000000000000000000000000000000004D00000000container-build-checks-1723452932.412e7f6/tests/oci-proper-derived/some-fileHi!
0707010000002F000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003C00000000container-build-checks-1723452932.412e7f6/tests/proper-base07070100000030000081A400000000000000000000000166B9CE0400000565000000000000000000000000000000000000004700000000container-build-checks-1723452932.412e7f6/tests/proper-base/DockerfileFROM scratch
LABEL org.openbuildservice.disturl="obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker"
LABEL org.opencontainers.image.created="2021-05-20T00:23:03.624005870Z"
LABEL org.opencontainers.image.description="Image containing a minimal environment for containers based on openSUSE Tumbleweed."
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Base Container"
LABEL org.opencontainers.image.url="https://www.opensuse.org/"
LABEL org.opencontainers.image.vendor="openSUSE Project"
LABEL org.opencontainers.image.version="20210519.14.19"
LABEL org.opensuse.base.created="2021-05-20T00:23:03.624005870Z"
LABEL org.opensuse.base.description="Image containing a minimal environment for containers based on openSUSE Tumbleweed."
LABEL org.opensuse.base.disturl="obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker"
LABEL org.opensuse.base.reference="registry.opensuse.org/opensuse/tumbleweed:20210519.14.19"
LABEL org.opensuse.base.title="openSUSE Tumbleweed Base Container"
LABEL org.opensuse.base.url="https://www.opensuse.org/"
LABEL org.opensuse.base.vendor="openSUSE Project"
LABEL org.opensuse.base.version="20210519.14.19"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/tumbleweed:20210519.14.19"
COPY some-file /some-file
07070100000031000081A400000000000000000000000166B9CE0400000121000000000000000000000000000000000000004700000000container-build-checks-1723452932.412e7f6/tests/proper-base/checks.outLooking at proper-base.containerinfo
Release: 14.19
Tag: opensuse/tumbleweed:latest
Tag: opensuse/tumbleweed:20210519
Tag: opensuse/tumbleweed:20210519.14.19
Detected image specific label prefix: org.opensuse.base
container-build-checks done. Hints: 0 Warnings: 0 Errors: 0
Exited with 0
07070100000032000081A400000000000000000000000166B9CE0400000532000000000000000000000000000000000000005600000000container-build-checks-1723452932.412e7f6/tests/proper-base/proper-base.containerinfo{
"buildtime" : 1621470206,
"disturl" : "obs://build.opensuse.org/openSUSE:Factory/images/e1b24f5d6cbf69cb7f8208acb618a4fe-opensuse-tumbleweed-image:docker",
"file" : "proper-base.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"name" : "opensuse-tumbleweed-image",
"release" : "14.19",
"repos" : [
{
"url" : "obsrepositories:/"
}
],
"tags" : [
"opensuse/tumbleweed:latest",
"opensuse/tumbleweed:20210519",
"opensuse/tumbleweed:20210519.14.19"
],
"tar_blobids" : [
"sha256:11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78",
"sha256:89a8c2a08e572bfd8ef8eb05648638443f0d50e4c9e9913f01adbeb2e89ec9cd"
],
"tar_manifest" : "[{\"Config\":\"sha256:11ea66ecb7888f020cd84d080ad417a7d4f02f74361cd1c2a4b4c70ffb0e9d78\",\"RepoTags\":[\"opensuse/tumbleweed:latest\",\"opensuse/tumbleweed:20210519\",\"opensuse/tumbleweed:20210519.14.19\"],\"Layers\":[\"sha256:89a8c2a08e572bfd8ef8eb05648638443f0d50e4c9e9913f01adbeb2e89ec9cd\"]}]",
"tar_md5sum" : "eb472571d516e44c1c05dc73a47f61e7",
"tar_mtime" : 1621470212,
"tar_sha256sum" : "7e8b9aaad5222b8680f17ffcf4c7f514783d86e3193b7f925c066a14113080de",
"tar_size" : 36567552,
"version" : "1.0.4"
}
07070100000033000081A400000000000000000000000166B9CE0400000004000000000000000000000000000000000000004600000000container-build-checks-1723452932.412e7f6/tests/proper-base/some-fileHi!
07070100000034000041ED00000000000000000000000266B9CE0400000000000000000000000000000000000000000000003F00000000container-build-checks-1723452932.412e7f6/tests/proper-derived07070100000035000081A400000000000000000000000166B9CE0400000429000000000000000000000000000000000000004A00000000container-build-checks-1723452932.412e7f6/tests/proper-derived/DockerfileFROM c-b-c-tests/proper-base
LABEL io.buildah.version="1.20.1"
LABEL org.openbuildservice.disturl="obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container"
LABEL org.opencontainers.image.created="2021-05-21T14:28:22.338350130Z"
LABEL org.opencontainers.image.description="This contains nano 5.7"
LABEL org.opencontainers.image.title="Example container"
LABEL org.opencontainers.image.version="5.7"
LABEL org.opensuse.example.created="2021-05-21T14:28:22.338350130Z"
LABEL org.opensuse.example.description="This contains nano 5.7"
LABEL org.opensuse.example.disturl="obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container"
LABEL org.opensuse.example.reference="registry.opensuse.org/opensuse/example:5.7.7.21"
LABEL org.opensuse.example.title="Example container"
LABEL org.opensuse.example.version="5.7"
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/example:5.7.7.21"
COPY some-file /some-file
07070100000036000081A400000000000000000000000166B9CE040000012C000000000000000000000000000000000000004A00000000container-build-checks-1723452932.412e7f6/tests/proper-derived/checks.outLooking at proper-derived.containerinfo
Release: 7.21
Tag: opensuse/example:latest
Tag: opensuse/example:5.7
Tag: opensuse/example:5.7.7.21
Tag: kubic/testtag:latest
Detected image specific label prefix: org.opensuse.example
container-build-checks done. Hints: 0 Warnings: 0 Errors: 0
Exited with 0
07070100000037000081A400000000000000000000000166B9CE04000005AF000000000000000000000000000000000000005C00000000container-build-checks-1723452932.412e7f6/tests/proper-derived/proper-derived.containerinfo{
"buildtime" : 1621607310,
"disturl" : "obs://build.opensuse.org/home:favogt:container-checks/containerfile/e6f02b3d61214e205f11d1c2075b14cc-dockerfile-application-container",
"file" : "proper-derived.tar",
"goarch" : "amd64",
"goos" : "linux",
"imageid" : "df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09",
"release" : "7.21",
"repos" : [
{
"url" : "obsrepositories:/"
}
],
"tags" : [
"opensuse/example:latest",
"opensuse/example:5.7",
"opensuse/example:5.7.7.21",
"kubic/testtag:latest"
],
"tar_blobids" : [
"sha256:43e763c1a9ac8eaa809d77c4ad0c543d78a826ba9d811eae19624c31e799fd1c",
"sha256:a0ea0ce79dfa175149b9f715342e13a9472ee6bfaeccfd4ecc6827f2494aef18",
"sha256:df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09"
],
"tar_manifest" : "[{\"Config\":\"sha256:df309d498c093685243d9d945f368076d88bb6bd181640fae752bf800c3cef09\",\"RepoTags\":[\"opensuse/example:latest\",\"opensuse/example:5.7\",\"opensuse/example:5.7.7.21\"],\"Layers\":[\"sha256:a0ea0ce79dfa175149b9f715342e13a9472ee6bfaeccfd4ecc6827f2494aef18\",\"sha256:43e763c1a9ac8eaa809d77c4ad0c543d78a826ba9d811eae19624c31e799fd1c\"]}]",
"tar_md5sum" : "72c8bfea4f24b5954cea7b788093e25c",
"tar_mtime" : 1621607315,
"tar_sha256sum" : "ee6344740bd7c23a9e4b9f2b5ff031b95566a0a7613ff082ed3a856a5559e297",
"tar_size" : 40647680,
"version" : "5.7"
}
07070100000038000081A400000000000000000000000166B9CE0400000004000000000000000000000000000000000000004900000000container-build-checks-1723452932.412e7f6/tests/proper-derived/some-fileHi!
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!147 blocks