Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a base image artifact #3451

Closed
KhaledSakr opened this issue Dec 26, 2019 · 6 comments
Closed

Building a base image artifact #3451

KhaledSakr opened this issue Dec 26, 2019 · 6 comments
Labels
area/artifact-dependencies area/build area/modules kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@KhaledSakr
Copy link

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.

Expected behavior

Should be able to build base artifacts and then pass the created tag to other artifacts.

Actual behavior

Currently there's no way no pass the tags to other artifacts.

Information

  • Skaffold version: v1.1.0
  • Operating system: Ubuntu 19.04
@balopat
Copy link
Contributor

balopat commented Jan 16, 2020

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.

@balopat balopat added priority/p3 agreed that this would be good to have, but no one is available at the moment. area/artifact-dependencies area/build labels Jan 16, 2020
@KhaledSakr
Copy link
Author

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.

@no1melman
Copy link

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.

@asavpatel
Copy link

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.

@no1melman
Copy link

Actually funnily enough I did come across it

#3831

@nkubala nkubala added this to the Icebox [P2+] milestone Sep 1, 2020
@briandealwis
Copy link
Member

Duplicate of #889 (closing)

Design proposed in #4794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/artifact-dependencies area/build area/modules kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

No branches or pull requests

6 participants