-
-
Notifications
You must be signed in to change notification settings - Fork 601
[Feature]: Allow the container working directory to be specified #1900
Copy link
Copy link
Closed
Labels
featureNew functionality or new behaviors on the existing oneNew functionality or new behaviors on the existing one
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or new behaviors on the existing oneNew functionality or new behaviors on the existing one