|
| 1 | +# OSC Packaging Container |
| 2 | + |
| 3 | + |
| 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 configuration. You can then check out packages, perform modifications, and |
| 24 | +send submissions to OBS. |
| 25 | + |
| 26 | +To work on an already checked out package, mount the current working directory: |
| 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%% |
| 34 | +``` |
| 35 | + |
| 36 | +The container entrypoint recognizes whether you are launching it for interactive |
| 37 | +usage or invoking `osc` directly. You can omit |
| 38 | +the command `osc` in the second case. For example: |
| 39 | + |
| 40 | +```ShellSession |
| 41 | +# podman run --rm -it \ |
| 42 | + -v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \ |
| 43 | + -v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \ |
| 44 | + registry.opensuse.org/opensuse/osc:%%osc_version%% ls openSUSE:Factory |
| 45 | +``` |
| 46 | + |
| 47 | +The command automatically forwards the arguments to `osc` and calls |
| 48 | +`osc ls openSUSE:Factory`. |
| 49 | + |
| 50 | + |
| 51 | +### Using the image labels |
| 52 | + |
| 53 | +The image provides two labels: `run` and `runcwd`. The first includes the full command, to run the `osc` container, while the second to run the container with the local working directory mounted. |
| 54 | + |
| 55 | +To view the labels, use the following command: |
| 56 | + |
| 57 | +```ShellSession |
| 58 | +# podman container runlabel run --display registry.opensuse.org/opensuse/osc:%%osc_version%% |
| 59 | +# podman container runlabel runcwd --display registry.opensuse.org/opensuse/osc:%%osc_version%% |
| 60 | +``` |
| 61 | + |
| 62 | +The labels can be used to run the container with Podman version 5.1.0 or later: |
| 63 | +```ShellSession |
| 64 | +# podman container runlabel run registry.opensuse.org/opensuse/osc:%%osc_version%% \ |
| 65 | + ls openSUSE:Factory |
| 66 | +``` |
| 67 | + |
| 68 | + |
| 69 | +### Connecting to build.suse.de |
| 70 | + |
| 71 | +build.suse.de uses an SSH-based authentication, which requires additional |
| 72 | +resources to be available in the container. You also must provide the internal certificate to the container: |
| 73 | + |
| 74 | +```ShellSession |
| 75 | +# podman run --rm -it \ |
| 76 | + -v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \ |
| 77 | + -v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \ |
| 78 | + -v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,z \ |
| 79 | + -v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:z \ |
| 80 | + -e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:z \ |
| 81 | + -v "$PWD":/root/osc-workdir:z \ |
| 82 | + registry.opensuse.org/opensuse/osc:%%osc_version%% |
| 83 | +``` |
| 84 | + |
| 85 | + |
| 86 | +## Limitations |
| 87 | + |
| 88 | +- Currently, it is not possible to build packages in a container. |
| 89 | +- The `runlabel run` command only works with Podman 5.1.0 and newer. |
| 90 | + |
| 91 | + |
| 92 | +## Volumes |
| 93 | + |
| 94 | +The container image is preconfigured to put `/var/tmp` into a volume. This |
| 95 | +directory is used by `osc` to store the buildroot and the package cache. |
| 96 | + |
| 97 | +## Licensing |
| 98 | + |
| 99 | +`SPDX-License-Identifier: MIT` |
| 100 | + |
| 101 | +This documentation and the build recipe are licensed as MIT. |
| 102 | +The container itself contains various software components under various open source licenses listed in the associated |
| 103 | +Software Bill of Materials (SBOM). |
| 104 | + |
| 105 | +This image is based on [openSUSE Tumbleweed](https://get.opensuse.org/tumbleweed/). |
0 commit comments