Skip to content

Commit 88f6f08

Browse files
dcermakSUSE Update Bot
authored andcommitted
Test build for #1050
1 parent f21074f commit 88f6f08

File tree

6 files changed

+145
-0
lines changed

6 files changed

+145
-0
lines changed

.obs/workflows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ staging_build:
105105
source_project: home:defolos:BCI:CR:Tumbleweed
106106
source_package: openjdk-21-devel-image
107107
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
108+
- branch_package:
109+
source_project: home:defolos:BCI:CR:Tumbleweed
110+
source_package: packaging-image
111+
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
108112
- branch_package:
109113
source_project: home:defolos:BCI:CR:Tumbleweed
110114
source_package: pcp-image
@@ -288,6 +292,9 @@ refresh_devel_BCI:
288292
- trigger_services:
289293
project: devel:BCI:Tumbleweed
290294
package: openjdk-21-devel-image
295+
- trigger_services:
296+
project: devel:BCI:Tumbleweed
297+
package: packaging-image
291298
- trigger_services:
292299
project: devel:BCI:Tumbleweed
293300
package: pcp-image

packaging-image/Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
17+
#!BuildTag: opensuse/osc:%%osc_version%%
18+
#!BuildTag: opensuse/osc:%%osc_version%%-%RELEASE%
19+
#!BuildTag: opensuse/osc:latest
20+
21+
FROM opensuse/tumbleweed:latest
22+
23+
MAINTAINER openSUSE (https://www.opensuse.org/)
24+
25+
# Define labels according to https://en.opensuse.org/Building_derived_containers
26+
# labelprefix=org.opensuse.application.osc
27+
LABEL org.opencontainers.image.title="openSUSE Tumbleweed Packaging"
28+
LABEL org.opencontainers.image.description="Packaging container based on the openSUSE Tumbleweed Base Container Image."
29+
LABEL org.opencontainers.image.version="%%osc_version%%"
30+
LABEL org.opencontainers.image.url="https://www.opensuse.org"
31+
LABEL org.opencontainers.image.created="%BUILDTIME%"
32+
LABEL org.opencontainers.image.vendor="openSUSE Project"
33+
LABEL org.opencontainers.image.source="%SOURCEURL%"
34+
LABEL io.artifacthub.package.readme-url="https://raw.githubusercontent.com/SUSE/BCI-dockerfile-generator/Tumbleweed/packaging-image/README.md"
35+
LABEL org.opensuse.reference="registry.opensuse.org/opensuse/osc:%%osc_version%%-%RELEASE%"
36+
LABEL org.openbuildservice.disturl="%DISTURL%"
37+
LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime"
38+
LABEL org.opensuse.release-stage="released"
39+
40+
# endlabelprefix
41+
LABEL run="podman run run --rm -it -v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z $IMAGE"
42+
LABEL runcwd="podman run run --rm -it -v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z -v $PWD:/root/osc-workdir:z $IMAGE"
43+
44+
RUN set -euo pipefail; zypper -n in --no-recommends osc 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 cpio 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 git openssh-common openssh-clients; zypper -n clean; rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}
45+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
46+
CMD ["/bin/bash"]
47+
WORKDIR /root/osc-workdir
48+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
49+
RUN chmod +x /usr/local/bin/entrypoint.sh
50+
51+
VOLUME /var/tmp

packaging-image/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Packaging Container
2+
3+
This is the openSUSE packaging container image, it includes all the necessary
4+
software to create and modify packages on the [Open Build
5+
Service](https://build.opensuse.org/) using
6+
[osc](https://github.com/openSUSE/osc/).
7+
8+
9+
## How to use this container image
10+
11+
This container image is intended for interactive usage with your `.oscrc` and
12+
the osc cookiejar mounted into the container:
13+
14+
```ShellSession
15+
# podman run --rm -it \
16+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
17+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:rw,z \
18+
registry.opensuse.org/opensuse/osc:%%osc_version%%-%RELEASE%
19+
```
20+
21+
The above command launches an interactive shell where your local osc config will
22+
be used. You can then proceed to checkout packages, perform modifications and
23+
send submissions to OBS.
24+
25+
To work on an already checked out package, mount the current working directory
26+
as well:
27+
28+
```ShellSession
29+
# podman run --rm -it \
30+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
31+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
32+
-v .:/root/osc-workdir:z \
33+
registry.opensuse.org/opensuse/osc:%%osc_version%%-%RELEASE%
34+
```
35+
36+
### Connecting to build.suse.de
37+
38+
build.suse.de uses a ssh based authentication and thus requires additional
39+
resources to be available in the container:
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+
-v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,z \
46+
-v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:z \
47+
-e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:z \
48+
-v "$PWD":/root/osc-workdir:z \
49+
registry.opensuse.org/opensuse/osc:%%osc_version%%-%RELEASE%
50+
```
51+
52+
53+
## Limitations
54+
55+
- It is currently not possible to build packages in a container.
56+
57+
58+
## Volumes
59+
60+
The container image is preconfigured to put `/var/tmp` into a volume. This
61+
directory is used by `osc` to store the buildroot and the package cache.

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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
13+
exec "$@"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-------------------------------------------------------------------
2+
Fri Apr 26 14:42:46 UTC 2024 - SUSE Update Bot <[email protected]>
3+
4+
- First version of the Packaging BCI

0 commit comments

Comments
 (0)