GoogleContainerTools/skaffold

Shouldn't default-repo be applied to cacheFrom directives?

Ouverte

#3 610 ouverte le 29 janv. 2020

 (9 commentaires) (7 réactions) (0 personne assignée)Go (1 416 forks)batch import
area/cachehelp wantedkind/bugpriority/p2

Métriques du dépôt

Stars
 (12 822 étoiles)
Métriques de merge PR
 (Merge moyen 3j 6h) (16 PRs mergées en 30 j)

Description

I'm trying very hard to optimize my DotNet multi-stage build process.

To do that I'm creating three profiles that I must execute in sequence.

Profile 1 - Base images Profile 2 - Dependency Builder Profile 3 - Final builder

The idea is to use caching and don't rebuild the whole system every time, and build in parallel things that are not dependent on others.

For each step, I want to use a previous image in cache or the image build in the latest profile. So was trying to use cacheFrom when I stumbled into that.

I use the --default-repo to set the image according to the branch, in runtime, and I expected the cache image to be pulled from my default repo, but It doesn't seem to be.

Additional

  • I would like to be able to use templating in the cacheFrom directive, so I can use the previous image and not necessarly the one tagged as latest.

Expected behavior

If default-repo is specified, cacheFrom images without full path should be rewriten if not fully qualified.

Actual behavior

Skaffold says the image could not be found.

Information

  • Skaffold version: 1.2.0
  • Operating system: Windows
  • Contents of skaffold.yaml:
profile:
- name: restore-stage
  build:
    local: 
      useBuildkit: false
    artifacts:
    - image: restore
      context: .
      docker:
        dockerfile: Dockerfile.default
        cacheFrom:
        - restore:latest
        target: pre_publish

Guide contributeur