Skip to content

Commit

Permalink
Test build for #2085
Browse files Browse the repository at this point in the history
  • Loading branch information
SUSE Update Bot committed Nov 28, 2024
1 parent bb75efa commit 6a68ff8
Show file tree
Hide file tree
Showing 11 changed files with 164 additions and 56 deletions.
11 changes: 9 additions & 2 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ staging_build:
source_project: home:defolos:BCI:CR:SLE-15-SP6
source_package: python-3.11-image
target_project: home:defolos:BCI:CR:SLE-15-SP6:Staging
- branch_package:
source_project: home:defolos:BCI:CR:SLE-15-SP6
source_package: sac-python-image
target_project: home:defolos:BCI:CR:SLE-15-SP6:Staging
- branch_package:
source_project: home:defolos:BCI:CR:SLE-15-SP6
source_package: python-3.12-image
Expand All @@ -187,7 +191,7 @@ staging_build:
target_project: home:defolos:BCI:CR:SLE-15-SP6:Staging
- branch_package:
source_project: home:defolos:BCI:CR:SLE-15-SP6
source_package: sac-python-3.9-image
source_package: sac-python-image
target_project: home:defolos:BCI:CR:SLE-15-SP6:Staging
- branch_package:
source_project: home:defolos:BCI:CR:SLE-15-SP6
Expand Down Expand Up @@ -382,6 +386,9 @@ refresh_devel_BCI:
- trigger_services:
project: devel:BCI:SLE-15-SP6
package: python-3.11-image
- trigger_services:
project: devel:BCI:SLE-15-SP6
package: sac-python-image
- trigger_services:
project: devel:BCI:SLE-15-SP6
package: python-3.12-image
Expand All @@ -390,7 +397,7 @@ refresh_devel_BCI:
package: python-3.6-image
- trigger_services:
project: devel:BCI:SLE-15-SP6
package: sac-python-3.9-image
package: sac-python-image
- trigger_services:
project: devel:BCI:SLE-15-SP6
package: distribution-image
Expand Down
14 changes: 0 additions & 14 deletions sac-python-3.9-image/_service

This file was deleted.

39 changes: 0 additions & 39 deletions sac-python-3.9-image/sac-python-3.9-image.changes

This file was deleted.

6 changes: 6 additions & 0 deletions sac-python-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!ExclusiveArch: do-not-build
#!ForceMultiVersion
#!BuildVersion: workaround-for-an-obs-bug
#!BuildRelease: 41

# For this container we only build the Dockerfile.$flavor builds.
60 changes: 60 additions & 0 deletions sac-python-image/Dockerfile.3.11
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-License-Identifier: MIT

# Copyright (c) 2024 SUSE LLC

# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon.

# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
# It is maintained by the BCI team and generated by
# https://github.com/SUSE/BCI-dockerfile-generator

# Please submit bugfixes or comments via https://bugs.opensuse.org/
# You can contact the BCI team via https://github.com/SUSE/bci/discussions

#!UseOBSRepositories
#!ExclusiveArch: aarch64 x86_64
#!BuildTag: containers/python:%%py311_ver%%-%RELEASE%
#!BuildTag: containers/python:%%py311_ver%%
#!BuildTag: containers/python:3.11
#!ForceMultiVersion
#!BcntSyncTag: sac-python-image
#!BuildName: containers-python-3.11
#!BuildVersion: %%py311_ver%%
#!BuildRelease: 41
FROM registry.suse.com/bci/bci-base:15.6

RUN set -euo pipefail; \
zypper -n install --no-recommends python311-devel python311 python311-pip curl findutils gawk git-core procps python311-wheel python311-pipx lifecycle-data-sle-module-python3 lifecycle-data-sle-module-development-tools; \
zypper -n clean; \
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.bci.python
LABEL org.opencontainers.image.authors=""
LABEL org.opencontainers.image.title="SLE BCI Python 3.11 development"
LABEL org.opencontainers.image.description="Python 3.11 development container based on the SLE Base Container Image."
LABEL org.opencontainers.image.version="%%py311_ver%%"
LABEL org.opencontainers.image.url="https://apps.rancher.io/applications/python"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opencontainers.image.source="%SOURCEURL%"
LABEL org.opencontainers.image.ref.name="%%py311_ver%%-%RELEASE%"
LABEL org.opensuse.reference="dp.apps.rancher.io/containers/python:%%py311_ver%%-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="l3"
LABEL com.suse.supportlevel.until="2027-12-31"
LABEL com.suse.eula="sle-bci"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15"
LABEL com.suse.release-stage="released"
# endlabelprefix
LABEL org.opencontainers.image.base.name="%BASE_REFNAME%"
LABEL org.opencontainers.image.base.digest="%BASE_DIGEST%"
LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.3.11.md"
ENV PYTHON_VERSION="%%py311_ver%%"
ENV PATH="$PATH:/root/.local/bin"
ENV PIP_VERSION="%%pip_ver%%"

RUN set -euo pipefail; install -d -m 0755 /root/.local/bin; ln -s /usr/bin/python3.11 /usr/local/bin/python3; \
ln -s /usr/bin/pydoc3.11 /usr/local/bin/pydoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#!BuildTag: containers/python:%%py39_ver%%
#!BuildTag: containers/python:3.9
#!ForceMultiVersion
#!BcntSyncTag: sac-python-image
#!BuildName: containers-python-3.9
#!BuildVersion: %%py39_ver%%
#!BuildRelease: 41
Expand Down Expand Up @@ -50,7 +51,7 @@ LABEL com.suse.release-stage="released"
# endlabelprefix
LABEL org.opencontainers.image.base.name="%BASE_REFNAME%"
LABEL org.opencontainers.image.base.digest="%BASE_DIGEST%"
LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.md"
LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.3.9.md"
ENV PYTHON_VERSION="%%py39_ver%%"
ENV PATH="$PATH:/root/.local/bin"
ENV PIP_VERSION="%%pip_ver%%"
Expand Down
54 changes: 54 additions & 0 deletions sac-python-image/README.3.11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Python 3.11 development container image

![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)[![SLSA](https://img.shields.io/badge/SLSA_(v1.0)-Build_L3-Green)](https://documentation.suse.com/sbp/server-linux/html/SBP-SLSA4/)
[![Provenance: Available](https://img.shields.io/badge/Provenance-Available-Green)](https://documentation.suse.com/container/all/html/Container-guide/index.html#container-verify)

## Description

[Python](https://www.python.org/) is an interpreted, interactive, object-oriented, open-source programming language. It incorporates modules, exceptions, dynamic typing, high-level dynamic data types, and classes. It provides interfaces to many system calls, libraries, and various window systems, and it is extensible in C or C++. It is also usable as an extension language for applications that require programmable interfaces.

## Usage

To deploy an application, install dependencies, copy the sources, and configure the application's main script:

```Dockerfile
FROM dp.apps.rancher.io/containers/python:3.11

WORKDIR /app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "python3", "./main-script.py" ]
```

Build and run the container image:

```ShellSession
$ podman build -t my-python-app .
$ podman run -it --rm my-python-app
```

To run a single script inside a container, use the following command:

```ShellSession
$ podman run --rm -v "$PWD":/app:Z -w /app dp.apps.rancher.io/containers/python:3.11 python3 script.py
```

## Additional tools

The Python container image includes [pip](https://pip.pypa.io/), [pipx](https://pipx.pypa.io/), [wheel](https://wheel.readthedocs.io/), Python Development Headers, and Git.

## Licensing

`SPDX-License-Identifier: MIT`

This documentation and the build recipe are licensed as MIT.
The container itself contains various software components under various open source licenses listed in the associated
Software Bill of Materials (SBOM).

This image is based on [SLE BCI](https://opensource.suse.com/bci/), a stable and redistributable foundation for software innovation. SLE BCI is enterprise-ready, and it comes with an option for support.

See the [SLE BCI EULA](https://www.suse.com/licensing/eula/#bci) for further information.
File renamed without changes.
4 changes: 4 additions & 0 deletions sac-python-image/_multibuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<multibuild>
<package>3.11</package>
<package>3.9</package>
</multibuild>
24 changes: 24 additions & 0 deletions sac-python-image/_service
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<services>
<service mode="buildtime" name="docker_label_helper"/>
<service mode="buildtime" name="kiwi_metainfo_helper"/>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile.3.11</param>
<param name="regex">%%py39_ver%%</param>
<param name="package">python39-base</param>
</service>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile.3.11</param>
<param name="regex">%%pip_ver%%</param>
<param name="package">python39-pip</param>
</service>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile.3.9</param>
<param name="regex">%%py39_ver%%</param>
<param name="package">python39-base</param>
</service>
<service name="replace_using_package_version" mode="buildtime">
<param name="file">Dockerfile.3.9</param>
<param name="regex">%%pip_ver%%</param>
<param name="package">python39-pip</param>
</service>
</services>vices>
5 changes: 5 additions & 0 deletions sac-python-image/sac-python-image.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-------------------------------------------------------------------
Thu Nov 28 21:33:14 UTC 2024 - SUSE Update Bot <bci-internal@suse.de>

- First version of the Python 3.9 development BCI

0 comments on commit 6a68ff8

Please sign in to comment.