You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 fieldWorkingDir
to theContainerRequest
struct, and use this field to set theWorkingDir
field in the DockerConfig
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
The text was updated successfully, but these errors were encountered: