GoogleContainerTools/skaffold

skaffold cache documentation

Open

#7,398 opened on May 12, 2022

View on GitHub
 (1 comment) (1 reaction) (0 assignees)Go (12,822 stars) (1,416 forks)batch import
area/docsbugbash/q4-2022help wantedkind/bugpriority/p2

Description

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

Contributor guide