This repository contains Dev Container Templates based on openSUSE Linux distro. The containers are suitable for development and programming in openSUSE.
| Template | Description |
|---|---|
| opensuse | openSUSE Leap or Tumbleweed with development tools, |
| agama | openSUSE + Agama installer development (Rust, Ruby, React, Kiwi) |
For both it is possible to enable optional Gemini and Claude support with SUSE default authentication configuration.
Developing in a containerized sandbox provides many useful advantages:
- All needed development tools are automatically installed.
- Ensures all developers have the same environment.
- You can develop from different version or from a completely different distribution (or even from Windows using WSL containers).
- The sandbox is useful when running AI code assisting tools.
- If you mess up the development system you can just rebuild the container and start from scratch.
- Want to develop on openSUSE Tumbleweed instead of Leap? Just switch the base system image and rebuild the container!
The dev container can be either used in Visual Studio Code or with the Devcontainer CLI.
- From the command palette (
F1orCtrl+Shift+P) select Dev Containers: Add Dev Container Configuration Files - Select Add configuration to workspace (the user data folder is not supported, the installation would fail there).
- Then insert either the
ghcr.io/lslezak/suse-devcontainer/opensuseorghcr.io/lslezak/suse-devcontainer/agamaname of the template depending which container you want to use. - Select the base product used for the new container, either openSUSE Leap or openSUSE Tumbleweed.
- If you selected the Agama container then select which Agama components you want to develop. The full (all-in-one) container image is quite big, almost 3GB. If you want to work only on a particular Agama part (like the Web frontend) you can select only that part and save some disk space.
- Then you can select some community features, but be careful, many of them
support only few Linux distributions. Quite often they are written only for
Ubuntu or Fedora and do not support openSUSE. (They usually install
additional packages using
aptordnfwithoutzyppersupport.) It's recommended to just skip this without selecting any additional features. - Then the container files will be generated to the
.devcontainerfolder. You can inspect them or possibly modify to fit your needs. See the Customization section below. - After opening the folder in VSCode click Open in Container in the bottom right corner or manually select Dev Containers: Rebuild and Open in Container from the command palette.
- Enjoy your openSUSE Dev Container and have a lot of fun! 😃
Install the devcontainer CLI from npm
(requires Node.js), the devcontainer command is installed to ~/.local/bin:
sudo zypper install npm-default
npm install --global --prefix ~/.local @devcontainers/cliAlternatively run it without installing via npx @devcontainers/cli.
Apply a template in the current directory:
devcontainer templates apply --workspace-folder . \
--template-id ghcr.io/lslezak/suse-devcontainer/opensuse \
--template-args '{"imageVariant": "tumbleweed"}'devcontainer templates apply --workspace-folder . \
--template-id ghcr.io/lslezak/suse-devcontainer/agama \
--template-args '{"imageVariant": "leap:16.1", "agamaVariant": "all-in-one"}'The devcontainer contains several parts in the .devcontainer directory:
Containerfile- the main container image definition, defines what is insidedevcontainer.json- defines how to run the container, which VSCode extensions should be installed, installs devcontainer features (small shareable parts of the container configuration)features/*- implement a small shareable self-contained container feature, theinstall.shis run during image build (basically extends theContainerfile), thedevcontainer-feature.jsonfile extends the basedevcontainer.jsonfile.
For basic customization you can change these values:
- Enable/disable the features in the
devcontainer.jsonfile - Change the list of installed VSCode extensions
- Configure hooks
- Install additional packages in
Containerfile(see theEXTRA_PACKAGESargument)
Exclude it locally and optionally track it in a separate repository:
echo "/.devcontainer/" >> .git/info/exclude
cd .devcontainer
git init -b main && git add . && git commit -m "Dev container configuration"
gh repo create <project>-devcontainer --private --source . --pushTo restore it in another checkout:
git clone git@github.com:<user>/<project>-devcontainer.git .devcontainer
echo "/.devcontainer/" >> .git/info/exclude- Template options are substituted for
${templateOption:<option>}in the template files. - Each template has its own copy of the features, the shared Gemini and Claude features must be identical (checked by the Validate workflow).
Build and test a template (requires the
devcontainer CLI, jq and Podman or
CONTAINER_ENGINE set):
test/smoke-test.sh opensuse imageVariant=tumbleweed- Increase the
versionindevcontainer-template.json. - Run the Release workflow, it publishes the
templates to
ghcr.io/lslezak/suse-devcontainer/<template-id>and opens a pull request with the generated documentation. - After the first release make the packages public in the GitHub settings.