Skip to content

Exec in container with custom user#7311

Merged
eddumelendez merged 4 commits intotestcontainers:mainfrom
megglos:meg-exec-in-container-user
Aug 15, 2023
Merged

Exec in container with custom user#7311
eddumelendez merged 4 commits intotestcontainers:mainfrom
megglos:meg-exec-in-container-user

Conversation

@megglos
Copy link
Contributor

@megglos megglos commented Jul 17, 2023

Hey folks,
first of all many thanks for this great library!

We are about the change the default user used in our docker image on https://github.com/camunda/zeebe from root to a less privileged user to better comply with docker security best practices.

Unfortunately we have some test setup code where we'd like to make use of root privileges still though 🙃 . We thus made use of the docker-java-api directly bypassing the ContainerState.execInContainer API offered by you to run commands, which we used previously.

Thus we figured it would be nice to expose the ExecCreateCmd.withUser API provided by the docker-java-api on testcontainer's ContainerState.

Curious on your feedback on this proposed change!

@megglos megglos requested a review from a team July 17, 2023 10:31
@megglos megglos force-pushed the meg-exec-in-container-user branch from 49e0ddd to 89a9f0a Compare July 17, 2023 10:32
@megglos megglos force-pushed the meg-exec-in-container-user branch from 89a9f0a to 2151f69 Compare July 18, 2023 06:16
* allows to run commands with a custom user
@megglos megglos force-pushed the meg-exec-in-container-user branch from 2151f69 to d42c942 Compare August 9, 2023 14:52
@eddumelendez eddumelendez added this to the next milestone Aug 15, 2023
@eddumelendez eddumelendez merged commit ea0b163 into testcontainers:main Aug 15, 2023
@eddumelendez
Copy link
Member

Thanks for your contribution, @megglos ! This will be part of the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants