Docker build&test workflow with plugins/docker

Hello,

When building docker containers, my first thought is that the easy solution would be to use plugins/docker.
However, I’m a bit lost with its behaviour. It seems it builds / pushes all in one step, while I’d like something like:

  • create myregistry/myapp image from Dockerfile
  • create myapp-tests from Dockerfile-tests (which would FROM myregistry/myapp and add my test tools) / run tests in this image.
  • run my tests (in some container created from myapp-tests image) - can run in several parallel steps.
  • if my tests are ok, tag & push myregistry/myapp.

As I couldn’t figure how to implement this with plugins/docker, I’m running this workflow on the host’s docker, with a socket mount in my runner. But I’m not satisfied with this solution.

Can you share how you do, if I’m wrong with my reasoning, if I missed something ?

Thanks.

it seems it builds / pushes all in one step, while I’d like something like

this is correct, the plugin builds and publishes the image in a single step by design. you are not required to use this plugin if it does not meet your use case. you can create your own plugins, or you can just execute the necessary shell commands as demonstrated here:

@hervenicol have you managed to create such a pipeline and would be able to share examples? I was pondering on the exact same thing.

No, I keep using the host’s docker daemon.
Do you want some info on using the host’s docker daemon?