Skaffold: Dockerfile dependencies improperly computed

Created on 5 Feb 2019  路  3Comments  路  Source: GoogleContainerTools/skaffold

It seems like there is a regression in how Skaffold discovers the dependencies for a Dockerfile.

Expected behavior

With skaffold-v0.21.1:

DEBU[0000] setting Docker user agent to skaffold-v0.21.1
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [tslint.json webpack.config.ts yarn.lock .yarnrc tsconfig.json .env integration-test tslint-rules package.json yarn-offline-mirror src locales]
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [src locales .env integration-test webpack.config.ts yarn-offline-mirror yarn.lock .yarnrc tsconfig.json tslint.json tslint-rules package.json]
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [tslint.json webpack.config.ts package.json .yarnrc locales .env integration-test tslint-rules yarn-offline-mirror yarn.lock src tsconfig.json]
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [package.json yarn-offline-mirror locales .env webpack.config.ts yarn.lock .yarnrc src tsconfig.json integration-test tslint.json tslint-rules]

Actual behavior

Note that none of the correct dependencies were discovered.

DEBU[0000] setting Docker user agent to skaffold-v0.22.0
INFO[0000] no config entry found for kube-context minikube
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [src locales tsconfig.json .env package.json]
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [package.json src locales tsconfig.json .env]
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [package.json src locales tsconfig.json .env]
DEBU[0000] Checking base image node:10.13-alpine for ONBUILD triggers.
DEBU[0000] Found dependencies for dockerfile: [tsconfig.json .env integration-test package.json src locales]

Information

  • Skaffold version: skaffold-v0.22.0
  • Operating system: Ubuntu 18.04 x64
  • Contents of skaffold.yaml:

Sorry, I'm probably not able to provide more.

# Skaffold Profiles
profiles:
  # Debugging development build
  - name: debug
    build:
      local:  { push: false }
      tagPolicy: { envTemplate: { template: '{{ .IMAGE_NAME }}:latest' } }
      artifacts:
        - image: registry.ng.bluemix.net/redacted
          docker: { target: target1 }
        - image: registry.ng.bluemix.net/redacted
          docker: { target: target2 }
        - image: registry.ng.bluemix.net/redacted
          docker: { target: target3 }
        - image: registry.ng.bluemix.net/redacted
          docker: { target: target4 }

Steps to reproduce the behavior

  1. Run skaffold dev --profile debug --cleanup=false
kinbug

Most helpful comment

@nathanph Never mind, I found the bug. The new code for not handling all the possible cases.
I'm on it

All 3 comments

@nathanph Thank you for the bug report!

v0.22.0 introduced what is supposed to be a fix to dependencies calculation when a target is specified on a Docker artifact. So it's expected that the list of dependencies could be different than what you had with v0.21.1.

However, if you think there's nonetheless a bug, it would be super useful if you could share the Dockerfile. Would that be possible?

@nathanph Never mind, I found the bug. The new code for not handling all the possible cases.
I'm on it

Great! Thanks @dgageot!

Let me know if you end up needing the Dockerfile and I can PM it to you somehow.

Oh wow, you've already got the fix in, lmao. You're fast.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

r2d4 picture r2d4  路  3Comments

abatilo picture abatilo  路  4Comments

GeertJohan picture GeertJohan  路  3Comments

ianlewis picture ianlewis  路  4Comments

heroic picture heroic  路  4Comments