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 request]: Allow specifiying the working directory #720

Closed
nicmr opened this issue Aug 8, 2024 · 3 comments
Closed

[Feature request]: Allow specifiying the working directory #720

nicmr opened this issue Aug 8, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@nicmr
Copy link
Contributor

nicmr commented Aug 8, 2024

Equivalent to the docker run -w, --workdir flag.
This would be extremely useful for some workloads and allow for feature parity with other testcontainer implementations.
I might try to contribute this myself if I can find the time - I will leave a comment in this thread if I start working on it.

For reference:

@DDtKey DDtKey added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 11, 2024
@DDtKey
Copy link
Collaborator

DDtKey commented Aug 11, 2024

Hi @nicmr 👋

Thank you for the request and references! 🙏

This shouldn’t be a problem to extend ContainerRequest and ImageExt

I will be glad to accept a PR

@nicmr
Copy link
Contributor Author

nicmr commented Aug 23, 2024

Hi @DDtKey, thank you for the hints. I've taken a look at the types you linked and bollard and I think I have a good idea of how to implement this. I'll try to submit a PR this weekend :)

@DDtKey DDtKey added this to the 0.22.0 milestone Aug 25, 2024
DDtKey pushed a commit that referenced this issue Aug 25, 2024
Implements #720 by adding support for setting the working directory on
`ImageExt` and `ContainerRequest`. Also adds a test for this feature.
This is equivalent to the `-w, --workdir` flag of `docker run`.

The abbreviation `working_dir` (as opposed to e.g. `working_directory`)
was chosen to use the same name as the `bollard` crate.
@nicmr
Copy link
Contributor Author

nicmr commented Aug 26, 2024

Closing this one as it was implemented with #724. Thank you for the guidance and the review @DDtKey. Also kudos for having such a clean codebase, it was easy to understand how things work under the hood.

@nicmr nicmr closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants