Use Github Hosted runners in GHA Container

I’d like to use a Github Hosted runner (e.g. ubuntu-latest) as the image for a job container, but it seems like it’s not possible (failure logs). Can you do that, and if not, where do I submit that as a feature request?

Could you explain why you need the container in that situation? If you have the exact environment you want in a VM running it in a container on that same VM has no benefit that’s obvious me.

On a technical level: The parameter you give to the container keyword must be a valid, public container image, the same way you’d use it with docker pull.

1 Like

Thanks for the reply! I was advised here to use a container as a method of mounting the /home/runner (and thereby, passing the docker credentials initialized by the docker login action to my container action), but one downside of using a container for that is that it can have unforeseen consequences for users. That’s why I was hoping to point users to just use an image that reflected the base runners, so that they wouldn’t shoot themselves in the foot by doing that.

Alternatively, if you have other suggestions for how to solve my linked problem, I’m all ears!

Hi @dfreilich,

For job container, it needs docker image not a VM. The hosted runners are created from https://github.com/actions/virtual-environments, and updated weekly. There is no docker image for the runner OS.

For your docker action dfreilich/pack-action, you can add action input to accept docker credentials similar as login action.

BTW, the feature request entry: https://support.github.com/contact/feedback?contact[category]=actions

Thanks