Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

Services: use a newly built container?

Solved! Go to Solution.

I have a workflow where I want to smoke test a container that is built in the same PR that I'm using it from. Imagine a build step that bakes the container, then starting another container.

 

I currently "hack" it a bit by having a build step that uses `docker save` to an artifact which is then downloaded for other build steps, then use compose to set it up. Since cache is coming, I can avoid the uploading part - but I'd also like to reduce the overall hacky-ness of using docker compose by using services. Perhaps its possible to restore the cache as a step prior the service is run somehow? Any input much appreciated!

2 Replies
Highlighted
Solution
GitHub Staff
Message 2 of 3

Re: Services: use a newly built container?

Services are setup before any of the users steps are run so there is no way to use a container in services that does not come from a registry right now.  We discussed some options in this area but we could not come up with a deterministic model to enable this workflow.

Highlighted
Copilot Lvl 2
Message 3 of 3

Re: Services: use a newly built container?

For what it's worth, I'm considering

- pushing to registry in a previous build (downside: these are clearly not suitable for public) and referencing it (for instance $image_name:PR-$github_sha)

- staying with not using services but increasing complexity with compose (downside: not very elegant, still requires manual setup for cache/reuse purposes)