I'm using skaffold to build and deploy multiple artifacts, but each of them are based on a base image that should be built and pushed first.
This is for example doable with docker-compose in the following way:
services:
base:
build:
context: ../base
image: base
users:
build:
context: ../users
And then the dockerfile for the users image:
FROM base
...
This workflow is currently not supported in skaffold as far as I understand.
Should be able to build base artifacts and then pass the created tag to other artifacts.
Currently there's no way no pass the tags to other artifacts.
Thanks @KhaledSakr for opening this - this seems reasonable to me. A design doc would be the first step for this kind of feature. We currently don't have the bandwidth to dig into it, but we could start on this by reviewing community designs. Would you be interested to dig deeper into this?
In the meantime - my (imperfect) solution would be in case of Dockerfiles to use a multistage dockerfile and use target in the artifact definitions.
Fair enough. Let me work on a proposal over the next few days.
Thanks for the suggestion. Unfortunately, it doesn't fit our use case. For now we build the base image in a seperate step before skaffold and then pass the tag to skaffold to be passed in turn to the artifacts as a buildArg. It's not pretty but it does the job.
Could you elaborate on this @balopat maybe show a sample skaffold.yaml
In the meantime - my (imperfect) solution would be in case of Dockerfiles to use a multistage dockerfile and use target in the artifact definitions.
Could you elaborate on this @balopat maybe show a sample skaffold.yaml
In the meantime - my (imperfect) solution would be in case of Dockerfiles to use a multistage dockerfile and use target in the artifact definitions.
yes I would second that, I tried scavenging through examples but couldn't find an example for this one.
Actually funnily enough I did come across it
https://github.com/GoogleContainerTools/skaffold/issues/3831
Duplicate of #889 (closing)
Design proposed in #4794
Most helpful comment
Could you elaborate on this @balopat maybe show a sample skaffold.yaml