|
| 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 |
| 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 |
| 56 | +backend. You **must** launch the container in privileged mode for building. |
| 57 | + |
| 58 | + |
| 59 | +### Using the image labels |
| 60 | + |
| 61 | +The image provides two labels: `run` and `runcwd`. The first includes the full |
| 62 | +command, to run the `osc` container, while the second to run the container with |
| 63 | +the local working directory mounted. |
| 64 | + |
| 65 | +To view the labels, use the following command: |
| 66 | + |
| 67 | +```ShellSession |
| 68 | +# podman container runlabel run --display registry.opensuse.org/opensuse/osc:%%osc_version%% |
| 69 | +# podman container runlabel runcwd --display registry.opensuse.org/opensuse/osc:%%osc_version%% |
| 70 | +``` |
| 71 | + |
| 72 | +The labels can be used to run the container with Podman version 5.1.0 or later: |
| 73 | +```ShellSession |
| 74 | +# podman container runlabel run \ |
| 75 | + registry.opensuse.org/opensuse/osc:%%osc_version%% \ |
| 76 | + ls openSUSE:Factory |
| 77 | +``` |
| 78 | + |
| 79 | + |
| 80 | +### Connecting to build.suse.de |
| 81 | + |
| 82 | +build.suse.de uses an SSH-based authentication, which requires additional |
| 83 | +resources to be available in the container. You also must provide the internal certificate to the container: |
| 84 | + |
| 85 | +```ShellSession |
| 86 | +# podman run --rm -it \ |
| 87 | + -v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \ |
| 88 | + -v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \ |
| 89 | + -v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,z \ |
| 90 | + -v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:z \ |
| 91 | + -e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:z \ |
| 92 | + -v "$PWD":/root/osc-workdir:z \ |
| 93 | + registry.opensuse.org/opensuse/osc:%%osc_version%% |
| 94 | +``` |
| 95 | + |
| 96 | + |
| 97 | +## Limitations |
| 98 | + |
| 99 | +- Currently, it is not possible to build packages in a container. |
| 100 | +- The `runlabel run` command only works with Podman 5.1.0 and newer. |
| 101 | + |
| 102 | + |
| 103 | +## Volumes |
| 104 | + |
| 105 | +The container image is preconfigured to put `/var/tmp` into a volume. This |
| 106 | +directory is used by `osc` to store the buildroot and the package cache. |
| 107 | + |
| 108 | +## Licensing |
| 109 | + |
| 110 | +`SPDX-License-Identifier: MIT` |
| 111 | + |
| 112 | +This documentation and the build recipe are licensed as MIT. |
| 113 | +The container itself contains various software components under various open source licenses listed in the associated |
| 114 | +Software Bill of Materials (SBOM). |
| 115 | + |
| 116 | +This image is based on [openSUSE Tumbleweed](https://get.opensuse.org/tumbleweed/). |
0 commit comments