Skip to content

Github actions: run multiple jobs in the same docker #26545

Answered by airtower-luna
w3ntao asked this question in Actions
Discussion options

You must be logged in to vote
wentaocn:

I wonder, can I build a docker for the 1st job, and then invoke multiple jobs execute command within the docker built from the 1st job? Thus I don’t have to keep multiple Dockerfile and save some docker building time.

I’m not exactly sure what you’re trying to do, do you want to use a container built in one job as the build environment (job container, even?) for later jobs?

One thing I can definitely say is that jobs in GitHub hosted runners each get a fresh VM, so if you build a container in one job and want to use it in another you have to push it to a registry, or store the image somewhere else.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants