Skip to content

fix(podman): Ensure compatibility with Podman - #1061

Merged
susnux merged 2 commits into
nextcloud-libraries:mainfrom
theCalcaholic:main
Jul 30, 2026
Merged

fix(podman): Ensure compatibility with Podman#1061
susnux merged 2 commits into
nextcloud-libraries:mainfrom
theCalcaholic:main

Conversation

@theCalcaholic

@theCalcaholic theCalcaholic commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Fixes a few issues preventing full compatibility with podman (as well as a few general issues I hit, see below)

Fixes #927

Fixes for podman compatibility

Socket selection

The socket is now read from the environment variable DOCKER_SOCKET (if set). This allows to configure the tool to use /run/podman/podman.sock or /run/user/$(id -u)/podman/podman.sock (for rootfull/rootless podman).

No docker exec

Instead of cy.exec('docker exec ...'), cypress uses now the same dockerode based implementation of runExec as playwright.

Explicit port mappings

Podman doesn't expose ports by default, breaking the expectation that Nextcloud will be available at http://:80 if the exposePort configuration option is not provided. This has been fixed for the tests, but still needs to be set by any projects that use the framework. One could be tempted to set a default of {exposePort: 80}, however I do not recommend this, because rootless Podman cannot expose that port by default (because only root can control ports < 1024, which are privileged ports on Linux) and it would cause confusing errors.

General fixes

Invalid usage of the docker API

For some reason, the createContainer call was ill configured - it was using the Volumes key to set the volume, but this is wrong according to the Docker API Spec which expects volumes to be configured via HostConfig.Mounts (using type "volume").

Missing await on container teardown

When stopping Nextcloud, the async function was not awaited properly.

Volume cleanup

The automated tests never cleaned up the apps_writable volume. I added this, however, it might make sense to provide a way to override (or generate) the volume name to not accidentally remove a volume that is used by anything else.
One option would be to prefix it with the current directory (similar to the container name), however, that might be a breaking change for some obscure scenarios (where users manually manipulate the volume/container between runs).

Testing

I mainly tested the included test (both npm run node:test and npm run playwright) each with podman rootless, podman rootfull and docker.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@theCalcaholic
theCalcaholic force-pushed the main branch 2 times, most recently from bd55092 to ee8f3a5 Compare July 25, 2026 00:48
@theCalcaholic theCalcaholic changed the title Fix compatibility with Podman fix(podman): Ensure compatibility with Podman Jul 28, 2026
Comment thread cypress.config.ts Outdated

@susnux susnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question added

@susnux susnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI errors related

@theCalcaholic

Copy link
Copy Markdown
Contributor Author

@susnux I applied the requested change

- lib/docker.ts: Fix volume syntax for createContainer
- cypress.config.ts, docker.spec.ts, runExec.spec.ts, start-nextcloud-server.mjs: Cleanup apps volume after tests

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
@susnux

susnux commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@theCalcaholic one remaining CI issue with linter.
Best to run npm run lint locally / npm run lint:fix

@theCalcaholic
theCalcaholic force-pushed the main branch 2 times, most recently from ccf9a4b to c6ca89f Compare July 30, 2026 09:32
@theCalcaholic

theCalcaholic commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@susnux Should be fixed now (apart from one remaining linting issue which is unrelated to my changes).

Comment thread lib/commands/state.ts Outdated
Comment thread lib/cypress.ts Outdated
@susnux susnux added 2. developing Work in progress bug Something isn't working labels Jul 30, 2026
- lib/docker.ts: Read docker socket path from env
- cypress.config.ts, docker.spec.ts, runExec.spec.ts: Expose port explicitly (because podman doesn't do that by default)
- cypress.config.ts: Expose runExec command from lib/docker.ts as cypress task

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
@susnux
susnux merged commit 1c9208e into nextcloud-libraries:main Jul 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cypress broken with podman rootless containers

2 participants