Skip to content

Commit dd1e34b

Browse files
author
SUSE Update Bot
committed
Test build for #1050
1 parent e9ecd77 commit dd1e34b

File tree

16 files changed

+268
-31
lines changed

16 files changed

+268
-31
lines changed

.obs/workflows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ staging_build:
141141
source_project: home:defolos:BCI:CR:Tumbleweed
142142
source_package: openjdk-23-devel-image
143143
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
144+
- branch_package:
145+
source_project: home:defolos:BCI:CR:Tumbleweed
146+
source_package: packaging-image
147+
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
144148
- branch_package:
145149
source_project: home:defolos:BCI:CR:Tumbleweed
146150
source_package: pcp-image
@@ -351,6 +355,9 @@ refresh_devel_BCI:
351355
- trigger_services:
352356
project: devel:BCI:Tumbleweed
353357
package: openjdk-23-devel-image
358+
- trigger_services:
359+
project: devel:BCI:Tumbleweed
360+
package: packaging-image
354361
- trigger_services:
355362
project: devel:BCI:Tumbleweed
356363
package: pcp-image

packaging-image/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
# Copyright (c) 2024 SUSE LLC
4+
5+
# All modifications and additions to the file contributed by third parties
6+
# remain the property of their copyright owners, unless otherwise agreed
7+
# upon.
8+
9+
# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
10+
# It is maintained by the BCI team and generated by
11+
# https://github.com/SUSE/BCI-dockerfile-generator
12+
13+
# Please submit bugfixes or comments via https://bugs.opensuse.org/
14+
# You can contact the BCI team via https://github.com/SUSE/bci/discussions
15+
16+
#!UseOBSRepositories
17+
18+
#!BuildTag: opensuse/osc:%%osc_version%%-%RELEASE%
19+
#!BuildTag: opensuse/osc:%%osc_version%%
20+
#!BuildTag: opensuse/osc:latest
21+
22+
FROM opensuse/tumbleweed:latest
23+
24+
RUN set -euo pipefail; \
25+
zypper -n install osc build cpio hostname obs-service-appimage obs-service-cargo obs-service-cdi_containers_meta obs-service-compose_kiwi_description obs-service-docker_label_helper obs-service-download_assets obs-service-download_files obs-service-download_url obs-service-extract_file obs-service-format_spec_file obs-service-go_modules obs-service-kiwi_label_helper obs-service-kiwi_metainfo_helper obs-service-kubevirt_containers_meta obs-service-node_modules obs-service-obs_scm obs-service-product_converter obs-service-recompress obs-service-refresh_patches obs-service-replace_using_env obs-service-replace_using_package_version obs-service-set_version obs-service-snapcraft obs-service-source_validator obs-service-tar obs-service-tar_scm obs-service-verify_file openSUSE-release openSUSE-release-appliance-docker bash-completion git obs-scm-bridge openssh-common openssh-clients podman runc; \
26+
zypper -n clean; \
27+
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}
28+
29+
# Define labels according to https://en.opensuse.org/Building_derived_containers
30+
# labelprefix=org.opensuse.application.osc
31+
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Packaging"
32+
LABEL org.opencontainers.image.description="Packaging container based on the openSUSE Tumbleweed Base Container Image."
33+
LABEL org.opencontainers.image.version="%%osc_version%%"
34+
LABEL org.opencontainers.image.url="https://www.opensuse.org"
35+
LABEL org.opencontainers.image.created="%BUILDTIME%"
36+
LABEL org.opencontainers.image.vendor="openSUSE Project"
37+
LABEL org.opencontainers.image.source="%SOURCEURL%"
38+
LABEL org.opencontainers.image.ref.name="%%osc_version%%-%RELEASE%"
39+
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/osc:%%osc_version%%-%RELEASE%"
40+
LABEL org.openbuildservice.disturl="%DISTURL%"
41+
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI"
42+
LABEL org.opensuse.release-stage="released"
43+
# endlabelprefix
44+
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/packaging-image/README.md"
45+
LABEL run="podman run --rm -it --privileged -v \$HOME/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v \$HOME/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z IMAGE"
46+
LABEL runv="podman run --rm -it --privileged -v \$HOME/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v \$HOME/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z -v pkgcache:/var/tmp/osbuild-packagecache IMAGE"
47+
LABEL runcwd="podman run --rm -it --privileged -v \$HOME/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v \$HOME/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z -v .:/root/osc-workdir:z IMAGE"
48+
LABEL runcwdv="podman run --rm -it --privileged -v \$HOME/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v \$HOME/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z -v pkgcache:/var/tmp/osbuild-packagecache -v .:/root/osc-workdir:z IMAGE"
49+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
50+
CMD ["/bin/bash"]
51+
WORKDIR /root/osc-workdir
52+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
53+
RUN chmod +x /usr/local/bin/entrypoint.sh
54+
ENV OSC_VM_TYPE=podman
55+
56+
VOLUME /var/tmp/osbuild-packagecache /var/tmp/build-root-root

packaging-image/README.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# OSC Packaging Container
2+
3+
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)
4+
5+
This is the openSUSE packaging container image that includes all the required
6+
tools for creating and modifying packages in the [Open Build
7+
Service](https://build.opensuse.org/) using
8+
[osc](https://github.com/openSUSE/osc/).
9+
10+
11+
## How to use this container image
12+
13+
The container image is intended for interactive usage with a `.oscrc` configuration file and
14+
the osc cookiejar mounted into the container:
15+
16+
```ShellSession
17+
# podman run --rm -it \
18+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
19+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:rw,z \
20+
registry.opensuse.org/opensuse/osc:%%osc_version%%
21+
```
22+
23+
The command launches an interactive shell environment that uses the local osc
24+
configuration. You can then check out packages, perform modifications, and send
25+
submissions to OBS.
26+
27+
To work on an already checked out package, mount the current working directory:
28+
29+
```ShellSession
30+
# podman run --rm -it \
31+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
32+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
33+
-v .:/root/osc-workdir:z \
34+
registry.opensuse.org/opensuse/osc:%%osc_version%%
35+
```
36+
37+
The container entrypoint recognizes whether you are launching it for interactive
38+
usage or invoking `osc` directly. You can omit the command `osc` in the second
39+
case. For example:
40+
41+
```ShellSession
42+
# podman run --rm -it \
43+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
44+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
45+
registry.opensuse.org/opensuse/osc:%%osc_version%% \
46+
ls openSUSE:Factory
47+
```
48+
49+
The command automatically forwards the arguments to `osc` and calls
50+
`osc ls openSUSE:Factory`.
51+
52+
53+
### Building packages
54+
55+
The container image can be used to build packages using the podman build backend
56+
(the default in this container image). The podman backend can only build RPM
57+
packages, building containers with docker or disk images with kiwi is not
58+
supported at the moment.
59+
60+
`osc` will cache build dependencies in the pre-configured `packagecachedir`. The
61+
`packagecachedir` defaults to `/var/tmp/osbuild-packagecache` and is declared as
62+
a volume in this container image. To speed up package builds, it is recommended
63+
to bind mount the package cache directory onto the host or use a persistent
64+
container volume, e.g. as follows:
65+
66+
```ShellSession
67+
# podman run --rm -it \
68+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
69+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
70+
-v pkgcache:/var/tmp/osbuild-packagecache \
71+
registry.opensuse.org/opensuse/osc:%%osc_version%%
72+
```
73+
74+
The above command only applies if you are using the default package cache
75+
location. Obtain the current setting via:
76+
77+
```ShellSession
78+
# osc config general packagecachedir
79+
'general': 'packagecachedir' is set to '/var/tmp/osbuild-packagecache'
80+
```
81+
82+
83+
### Using the image labels
84+
85+
The image provides four labels: `run`, `runv`, `runcwd`, `runcwdv`. The `run`
86+
label includes the full command, to run the `osc` container, while the `runcwd`
87+
label additionally mounts the current working directory to `/root/osc-workdir`
88+
(the container images' working directory). The labels with the `v` appended
89+
additionally include the directive to mount a container volume called `pkgcache`
90+
to `/var/tmp/osbuild-packagecache`.
91+
92+
To view the labels, use the following command:
93+
94+
```ShellSession
95+
# podman container runlabel run --display registry.opensuse.org/opensuse/osc:%%osc_version%%
96+
```
97+
98+
The labels can be used to run the container with Podman version 5.1.0 or later:
99+
100+
```ShellSession
101+
# podman container runlabel run \
102+
registry.opensuse.org/opensuse/osc:%%osc_version%% \
103+
ls openSUSE:Factory
104+
```
105+
106+
107+
### Connecting to build.suse.de
108+
109+
build.suse.de uses an SSH-based authentication, which requires additional
110+
resources to be available in the container. You also must provide the internal certificate to the container:
111+
112+
```ShellSession
113+
# podman run --rm -it \
114+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
115+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
116+
-v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,z \
117+
-v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:z \
118+
-e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:z \
119+
-v "$PWD":/root/osc-workdir:z \
120+
registry.opensuse.org/opensuse/osc:%%osc_version%%
121+
```
122+
123+
124+
## Limitations
125+
126+
- Currently, it is not possible to build container images or disk images in a
127+
container.
128+
- The `runlabel run` command only works with Podman 5.1.0 and newer.
129+
130+
131+
## Volumes
132+
133+
The container image is preconfigured to put `/var/tmp` into a volume. This
134+
directory is used by `osc` to store the buildroot and the package cache.
135+
136+
## Licensing
137+
138+
`SPDX-License-Identifier: MIT`
139+
140+
This documentation and the build recipe are licensed as MIT.
141+
The container itself contains various software components under various open source licenses listed in the associated
142+
Software Bill of Materials (SBOM).
143+
144+
This image is based on [openSUSE Tumbleweed](https://get.opensuse.org/tumbleweed/).

packaging-image/_service

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<services>
2+
<service mode="buildtime" name="docker_label_helper"/>
3+
<service mode="buildtime" name="kiwi_metainfo_helper"/>
4+
<service name="replace_using_package_version" mode="buildtime">
5+
<param name="file">Dockerfile</param>
6+
<param name="regex">%%osc_version%%</param>
7+
<param name="package">osc</param>
8+
</service>
9+
</services>

packaging-image/entrypoint.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
if [[ ! -e /root/.config/osc/oscrc ]]; then
4+
cat << EOF
5+
This container is expected to be launched with your oscrc mounted to
6+
/root/.config/osc/oscrc
7+
8+
Please consult the README or the label 'run' for the full invocation.
9+
EOF
10+
fi
11+
12+
if [[ "-h --help -v --verbose -q --quiet --debug --debugger --post-mortem --traceback -H --http-debug --http-full-debug -A --apiurl --config --setopt --no-keyring add addchannels addcontainers addremove ar aggregatepac api branch getpac bco branchco browse build wipe shell chroot buildconfig buildhistory buildhist buildinfo buildlog buildlogtail blt bl cat less blame changedevelrequest changedevelreq cr checkconstraints checkout co clean cleanassets ca clone comment commit checkin ci config copypac create-pbuild-config cpc createincident createrequest creq delete remove del rm deleterequest deletereq droprequest dropreq dr dependson detachbranch develproject dp bsdevelproject diff di ldiff linkdiff distributions dists downloadassets da enablechannels enablechannel fork getbinaries help importsrcpkg info init jobhistory jobhist linkpac linktobranch list LL lL ll ls localbuildlog lbl lock log maintainer bugowner maintenancerequest mr mbranch maintained sm meta mkpac mv my patchinfo pdiff prdiff projdiff projectdiff prjresults pr pull pull_request rdelete rdiff rebuild rebuildpac release releaserequest remotebuildlog remotebuildlogtail rbuildlogtail rblt rbuildlog rbl repairlink repairwc repo repositories platforms repos repourls request review rq requestmaintainership reqbs reqms reqmaintainership requestbugownership reqbugownership resolved restartbuild abortbuild results r revert rpmlintlog lint rpmlint rremove search bse se sendsysrq service setdevelproject sdp setlinkrev showlinked signkey staging status st submitrequest submitpac submitreq sr token triggerreason tr undelete unlock update up updatepacmetafromspec updatepkgmetafromspec metafromspec vc version whatdependson whois user who wipebinaries unpublish workerinfo" =~ (^|[[:space:]])$1($|[[:space:]]) ]]; then
13+
# looks like the user is executing the container as the osc command
14+
osc "$@"
15+
else
16+
exec "$@"
17+
fi
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-------------------------------------------------------------------
2+
Mon Nov 04 13:45:57 UTC 2024 - SUSE Update Bot <[email protected]>
3+
4+
- First version of the Packaging BCI

rust-oldstable-image/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
#!BuildTag: opensuse/bci/rust:oldstable
2020
#!BuildTag: opensuse/bci/rust:%%RUST_VERSION%%-2.%RELEASE%
2121
#!BuildTag: opensuse/bci/rust:%%RUST_VERSION%%
22-
#!BuildTag: opensuse/bci/rust:1.80
22+
#!BuildTag: opensuse/bci/rust:1.81
2323

2424
FROM opensuse/tumbleweed:latest
2525

2626
RUN set -euo pipefail; \
27-
zypper -n install --no-recommends rust1.80 cargo1.80; \
27+
zypper -n install --no-recommends rust1.81 cargo1.81; \
2828
zypper -n clean; \
2929
rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}
3030

3131
# Define labels according to https://en.opensuse.org/Building_derived_containers
3232
# labelprefix=org.opensuse.bci.rust
33-
LABEL org.opencontainers.image.title="openSUSE Tumbleweed BCI Rust 1.80"
34-
LABEL org.opencontainers.image.description="Rust 1.80 container based on the openSUSE Tumbleweed Base Container Image."
33+
LABEL org.opencontainers.image.title="openSUSE Tumbleweed BCI Rust 1.81"
34+
LABEL org.opencontainers.image.description="Rust 1.81 container based on the openSUSE Tumbleweed Base Container Image."
3535
LABEL org.opencontainers.image.version="%%RUST_VERSION%%"
3636
LABEL org.opencontainers.image.url="https://www.opensuse.org"
3737
LABEL org.opencontainers.image.created="%BUILDTIME%"

rust-oldstable-image/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Rust 1.80 Container Image
1+
# Rust 1.81 Container Image
22

33
![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)
44

@@ -11,8 +11,8 @@
1111
To compile and deploy an application, copy the sources, fetch dependencies, and build the binary:
1212

1313
```Dockerfile
14-
# Build the application using the Rust 1.80 container image
15-
FROM registry.opensuse.org/opensuse/bci/rust:1.80 as build
14+
# Build the application using the Rust 1.81 container image
15+
FROM registry.opensuse.org/opensuse/bci/rust:1.81 as build
1616

1717
WORKDIR /app
1818

@@ -40,7 +40,7 @@ There are situations, where you don't want to run an application inside a contai
4040
To compile the application, without running it inside a container instance, use the following command:
4141

4242
```ShellSession
43-
$ podman run --rm -v "$PWD":/app:Z -w /app registry.opensuse.org/opensuse/bci/rust:1.80 cargo build --release
43+
$ podman run --rm -v "$PWD":/app:Z -w /app registry.opensuse.org/opensuse/bci/rust:1.81 cargo build --release
4444
```
4545

4646
**Note:** The Rust image is intended to be used as a build environment. For runtime, use smaller images such as `bci-base`, `bci-micro`, or `bci-minimal`.

rust-oldstable-image/_service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<service name="replace_using_package_version" mode="buildtime">
55
<param name="file">Dockerfile</param>
66
<param name="regex">%%RUST_VERSION%%</param>
7-
<param name="package">rust1.80</param>
7+
<param name="package">rust1.81</param>
88
</service>
99
<service name="replace_using_package_version" mode="buildtime">
1010
<param name="file">Dockerfile</param>
1111
<param name="regex">%%CARGO_VERSION%%</param>
12-
<param name="package">cargo1.80</param>
12+
<param name="package">cargo1.81</param>
1313
</service>
1414
</services>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
requires:cargo1.80
2-
requires:rust1.80
1+
requires:cargo1.81
2+
requires:rust1.81

0 commit comments

Comments
 (0)