GenericContainer withFileSystemBind: creates a root owned directory/file

Open
#8,871 1 comment 4 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, java
Domain
devops, testing-qa

Research direction

Start at GenericContainer.withFileSystemBind and reproduce the READ_WRITE bind on Ubuntu 22.04.4 with Docker 26.1.4, checking how the root-owned directory or file is created. Done means establishing whether ownership can follow the current non-root user and verifying the behavior with a regression test.

Written by the indexing model from the issue text.

Description

type/bug
Module

Core

Testcontainers version

1.19.8

Using the latest Testcontainers version?

Yes

Host OS

Ubuntu 22.04.4 LTS

Host Arch

x86

Docker version
26.1.4
What happened?

Using the following statement:

new GenericContainer<>("...")
  ...
  .withFileSystemBind("...", "...", BindMode.READ_WRITE)
  ...;

creates a root:root directory/file while executed by a normal, non-root user.

Is there any way to avoid that and to create directories/files owned by the current user ?

Relevant log output

No response

Additional Information

No response

Dominant language
Java
Stars
8.8k
Forks
2k
Avg merge
2d 1h
Merged PRs (30d)
11

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from testcontainers/testcontainers-java

All issues in testcontainers/testcontainers-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.