Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Allow the container working directory to be specified #1900

Closed
fhke opened this issue Nov 4, 2023 · 1 comment
Closed

[Feature]: Allow the container working directory to be specified #1900

fhke opened this issue Nov 4, 2023 · 1 comment
Labels
feature New functionality or new behaviors on the existing one

Comments

@fhke
Copy link
Contributor

fhke commented Nov 4, 2023

Problem

There is presently no way to set the working directory for the launched container. This complicates, and in some cases prevents, the use of relative paths in the container.

Solution

Add a new string type field WorkingDir to the ContainerRequest struct, and use this field to set the WorkingDir field in the Docker Config struct when creating a container.

Benefit

Users of testcontainers can operate on relative paths, and work in an isolated directory, without setting the working directory inside the container.

Alternatives

Depending on the use case users may be able to set the current working directory inside the process, either using the cd shell builtin or native language constructs.

Would you like to help contributing this feature?

Yes

@fhke fhke added the feature New functionality or new behaviors on the existing one label Nov 4, 2023
@mdelapenya
Copy link
Collaborator

Closed by #1899, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

No branches or pull requests

2 participants