Skip to content

Commit d77b5aa

Browse files
dcermakSUSE Update Bot
authored andcommitted
Test build for #1050
1 parent f46df79 commit d77b5aa

File tree

7 files changed

+184
-3
lines changed

7 files changed

+184
-3
lines changed

.obs/workflows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ staging_build:
113113
source_project: home:defolos:BCI:CR:Tumbleweed
114114
source_package: openjdk-22-devel-image
115115
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
116+
- branch_package:
117+
source_project: home:defolos:BCI:CR:Tumbleweed
118+
source_package: packaging-image
119+
target_project: home:defolos:BCI:CR:Tumbleweed:Staging
116120
- branch_package:
117121
source_project: home:defolos:BCI:CR:Tumbleweed
118122
source_package: pcp-image
@@ -306,6 +310,9 @@ refresh_devel_BCI:
306310
- trigger_services:
307311
project: devel:BCI:Tumbleweed
308312
package: openjdk-22-devel-image
313+
- trigger_services:
314+
project: devel:BCI:Tumbleweed
315+
package: packaging-image
309316
- trigger_services:
310317
project: devel:BCI:Tumbleweed
311318
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 --rm -it -v \$HOME/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z -v \$HOME/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z IMAGE"
42+
LABEL runcwd="podman run --rm -it -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"
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: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Packaging Container
2+
3+
This is the openSUSE packaging container image, it includes all the necessary
4+
software to create and modify packages in 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+
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+
27+
```ShellSession
28+
# podman run --rm -it \
29+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
30+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
31+
-v .:/root/osc-workdir:z \
32+
33+
```
34+
35+
The container entrypoint recognizes whether you are launching it for interactive
36+
usage or whether you are invoking `osc` directly. For convenience, you can omit
37+
the command `osc` in the second case. E.g.:
38+
39+
```ShellSession
40+
# podman run --rm -it \
41+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
42+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
43+
-v .:/root/osc-workdir:z \
44+
ls openSUSE:Factory
45+
```
46+
47+
The above command will automatically invoke forward the arguments to `osc` and
48+
call `osc ls openSUSE:Factory`.
49+
50+
51+
### Using the image labels
52+
53+
The image provides two labels `run` and `runcwd` which include the full command
54+
to run the `osc` container or run it with the local working directory mounted as
55+
well.
56+
57+
These labels can be shown via:
58+
59+
```ShellSession
60+
# podman container runlabel run --display
61+
# podman container runlabel runcwd --display
62+
```
63+
64+
Note that it is currently not yet possible to execute these labels with podman.
65+
66+
67+
### Connecting to build.suse.de
68+
69+
build.suse.de uses a ssh based authentication and thus requires additional
70+
resources to be available in the container. Additionally, you have to provide
71+
the internal certificate to the container as well:
72+
73+
```ShellSession
74+
# podman run --rm -it \
75+
-v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \
76+
-v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \
77+
-v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,z \
78+
-v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:z \
79+
-e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:z \
80+
-v "$PWD":/root/osc-workdir:z \
81+
82+
```
83+
84+
85+
## Limitations
86+
87+
- It is currently not possible to build packages in a container.
88+
89+
90+
## Volumes
91+
92+
The container image is preconfigured to put `/var/tmp` into a volume. This
93+
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: 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 May 06 09:06:56 UTC 2024 - SUSE Update Bot <[email protected]>
3+
4+
- First version of the Packaging BCI

tomcat-10-image/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To deploy an application, copy the `.war` file file into
2121
`$CATALINA_BASE/webapps` (either during a container build or by bind-mounting
2222
the directory), and launch the container using the following command:
2323
```ShellSession
24-
$ podman run -d --rm -p 8080:8080 registry.opensuse.org/opensuse/tomcat:10
24+
$ podman run -d --rm -p 8080:8080 registry.opensuse.org/opensuse/tomcat:latest
2525
```
2626

2727
The deployed webapp is then accessible via `http://localhost:8080/$webapp_name`.
@@ -38,7 +38,7 @@ follows:
3838
```ShellSession
3939
$ chmod 0777 /path/to/my/app
4040
$ podman run --rm -d -v /path/to/my/app:/usr/share/tomcat/webapps:z \
41-
-p 8080:8080 registry.opensuse.org/opensuse/tomcat:10
41+
-p 8080:8080 registry.opensuse.org/opensuse/tomcat:latest
4242
```
4343

4444

@@ -54,7 +54,7 @@ options to the container runtime using the `-e` flag:
5454
```ShellSession
5555
$ podman run -it --rm \
5656
-e JAVA_OPTS="-Xmx1024m" -p 8080:8080 \
57-
registry.opensuse.org/opensuse/tomcat:10
57+
registry.opensuse.org/opensuse/tomcat:latest
5858
```
5959

6060
The image ships with `CATALINA_HOME` set to `/usr/share/tomcat`

0 commit comments

Comments
 (0)