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

Shell-less containers #109

Open
wneirynck opened this issue Mar 6, 2024 · 1 comment
Open

Shell-less containers #109

wneirynck opened this issue Mar 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wneirynck
Copy link
Contributor

wneirynck commented Mar 6, 2024

Currently the OCI container driver requires that /bin/sh is present in the image to execute the job along with the sidecar. This poses a problem for minimal images that do not provide this (like Kaniko). The OCI container instances currently have no way to create init containers, only simultaneously started containers. Possible solutions to this problem could be:

  • Run these containers using another driver, like Kubernetes, that do allow init containers to prepare the workspace
  • Don't support this and have the user use another (possibly derived) image that contains /bin/sh.
  • Create a custom image at runtime (e.g. using buildah that adds the workspace files and then run this container.

All of the above require some intervention from the user, at the minimum by setting some flag to indicate to MonkeyCI that there is special treatment required. It is however possible to "inspect" image contents without executing it, to see if the shell executable is present. See this StackOverflow answer. This would at least allow us to avoid user intervention, at the cost of more complexity and performance.

@wneirynck wneirynck added the bug Something isn't working label Mar 6, 2024
@wneirynck
Copy link
Contributor Author

Using buildah again requires privileged containers, or perhaps a lot of fiddling with permissions and setuid/setgid stuff. This could be possible if we set up some microservice whose responsability would be creating these custom containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant