|
| 1 | +# OSC Packaging Container |
| 2 | + |
| 3 | +{% include 'badges.j2' %} |
| 4 | + |
| 5 | +This is the openSUSE packaging container image, it includes all the necessary |
| 6 | +software to create and modify 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 | +This container image is intended for interactive usage with your `.oscrc` 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 | + {{ image.pretty_reference }} |
| 21 | +``` |
| 22 | + |
| 23 | +The above command launches an interactive shell where your local osc config will |
| 24 | +be used. You can then proceed to checkout packages, perform modifications and |
| 25 | +send 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 | + {{ image.pretty_reference }} |
| 35 | +``` |
| 36 | + |
| 37 | +The container entrypoint recognizes whether you are launching it for interactive |
| 38 | +usage or whether you are invoking `osc` directly. For convenience, you can omit |
| 39 | +the command `osc` in the second case. E.g.: |
| 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 | + {{ image.pretty_reference }} ls openSUSE:Factory |
| 46 | +``` |
| 47 | + |
| 48 | +The above command will automatically forward the arguments to `osc` and call |
| 49 | +`osc ls openSUSE:Factory`. |
| 50 | + |
| 51 | + |
| 52 | +### Using the image labels |
| 53 | + |
| 54 | +The image provides two labels `run` and `runcwd` which include the full command |
| 55 | +to run the `osc` container or run it with the local working directory mounted as |
| 56 | +well. |
| 57 | + |
| 58 | +These labels can be shown via: |
| 59 | + |
| 60 | +```ShellSession |
| 61 | +# podman container runlabel run --display {{ image.pretty_reference }} |
| 62 | +# podman container runlabel runcwd --display {{ image.pretty_reference }} |
| 63 | +``` |
| 64 | + |
| 65 | +The labels can be used to run the container with podman version 5.1.0 or later: |
| 66 | +```ShellSession |
| 67 | +# podman container runlabel run {{ image.pretty_reference }} \ |
| 68 | + ls openSUSE:Factory |
| 69 | +``` |
| 70 | + |
| 71 | + |
| 72 | +### Connecting to build.suse.de |
| 73 | + |
| 74 | +build.suse.de uses a ssh based authentication and thus requires additional |
| 75 | +resources to be available in the container. Additionally, you have to provide |
| 76 | +the internal certificate to the container as well: |
| 77 | + |
| 78 | +```ShellSession |
| 79 | +# podman run --rm -it \ |
| 80 | + -v ~/.config/osc/oscrc:/root/.config/osc/oscrc:ro,z \ |
| 81 | + -v ~/.local/state/osc/cookiejar:/root/.local/state/osc/cookiejar:z \ |
| 82 | + -v /etc/ssl/ca-bundle.pem:/etc/ssl/ca-bundle.pem:ro,z \ |
| 83 | + -v $SSH_AUTH_SOCK:/run/user/0/ssh-agent.socket:z \ |
| 84 | + -e SSH_AUTH_SOCK=/var/run/user/0/ssh-agent.socket:z \ |
| 85 | + -v "$PWD":/root/osc-workdir:z \ |
| 86 | + {{ image.pretty_reference }} |
| 87 | +``` |
| 88 | + |
| 89 | + |
| 90 | +## Limitations |
| 91 | + |
| 92 | +- It is currently not possible to build packages in a container. |
| 93 | +- The `runlabel run` command only works with podman 5.1.0 and newer. |
| 94 | + |
| 95 | + |
| 96 | +## Volumes |
| 97 | + |
| 98 | +The container image is preconfigured to put `/var/tmp` into a volume. This |
| 99 | +directory is used by `osc` to store the buildroot and the package cache. |
| 100 | + |
| 101 | +{% include 'licensing_and_eula.j2' %} |
0 commit comments