GoogleContainerTools/skaffold

skaffold cache documentation

Open

#7398 aperta il 12 mag 2022

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)Go (1416 fork)batch import
area/docsbugbash/q4-2022help wantedkind/bugpriority/p2

Metriche repository

Star
 (12.822 star)
Metriche merge PR
 (Merge medio 1g 18h) (18 PR mergiate in 30 g)

Descrizione

Expected behavior

Actual behavior

Information

  • Skaffold version: v1.38.0
  • Operating system: macos and centos
  • Installed via: curl
  • Contents of skaffold.yaml:

the following is a snippet of skaffold apiVersion: skaffold/v2beta17

profiles:
- name: buildbase
  build:
    local:
      push: false
    artifacts:
    - image: test/test-base
      context: ../../../..
      docker:
        dockerfile: apps/test/deploy/docker/Dockerfile
    tagPolicy:
      envTemplate:
        template: 'dev34'
- name: test
  build:
    artifacts:
    - image: test/test-test
      context: ../../../..
      docker:
        dockerfile: apps/test/deploy/docker/Dockerfile_tester
        target: tester
        buildArgs:
          DOCKERFILE_BASE: test/test-base:dev34
    tagPolicy:
      envTemplate:
        template: "dev34"
    local:
      push: false
- name: remote
  build:
    local:
      push: true
    artifacts:
    - image: testregistryaq.azurecr.io/test/test
      context: ../../../..
      docker:
        dockerfile: apps/test/deploy/docker/Dockerfile_runtime
        buildArgs:
          DOCKERFILE_BASE: test/test-base:dev34
    tagPolicy:
      envTemplate:
        template: 'dev34'

###Dockerfiles Dockerfile

FROM node:14
COPY . .
COPY test-tonton /tmp/test-tonton

Dockerfile_tester

ARG DOCKERFILE_BASE
FROM ${DOCKERFILE_BASE} AS tester

Dockerfile_runtime

ARG DOCKERFILE_BASE
FROM ${DOCKERFILE_BASE} AS runtime

Steps to reproduce the behavior

  • if we change the content of the file test-tonton skaffold, using the profile buildbase, will build a new image, BUT the profile test will not build a new image saying Found Locally

  • if we add a new layer in the Dockerfile of the profile buildbase, skaffold will build a new image when using the profile test

  • for the profile remote whatever we change in the base image skaffold will not rebuild the child image saying Found Remotly

please can you add an explan how the cache works in the background to know what to expect

Guida contributor