|
| 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. |
0 commit comments