actions / runner-container-hooks

Runner Container Hooks for GitHub Actions
MIT License
67 stars 43 forks source link

docker: Do not overwrite entrypoint if it has already been set or if it is Service container #83

Closed s4ichi closed 1 year ago

s4ichi commented 1 year ago

related: https://github.com/actions/runner-container-hooks/issues/44

When using service container with container hooks for docker, is it possible to stop the overwriting of the entrypoint?

Currently, container hooks for docker does not allow the use of service container for some docker images. This is because the setupContainer function sets tail as entryPoint field in any case. This behavior prevents, for example, postgres or mysql cannot be started (by overriding their configured entrypoint).

setupContainer function: https://github.com/actions/runner-container-hooks/blob/ebbe2bdaffea3efb4f0ac1eaf1b381be53a78bdc/packages/docker/src/hooks/prepare-job.ts#L178-L179

I think this is the same problem as https://github.com/actions/runner-container-hooks/issues/44. So, I tried to write a patch based on https://github.com/actions/runner-container-hooks/pull/45.

I didn't know why the entrypoint was overwritten initially, so if you have a workaround, I would appreciate it if you could let me know.