GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.08k stars 1.63k forks source link

Error parsing complex Dockerfile FROM statement. #9079

Open mmx86 opened 1 year ago

mmx86 commented 1 year ago
ARG DOCKER_REGISTRY
FROM ${DOCKER_REGISTRY:+${DOCKER_REGISTRY}/}python:3.10-buster
...

Build results in:

getting hash for artifact "dsp-test": getting dependencies for "dsp-test": parsing ONBUILD instructions: retrieving image "${DOCKER_REGISTRY:/}python:3.10-buster": parsing reference "${DOCKER_REGISTRY:/}python:3.10-buster": could not parse reference: ${DOCKER_REGISTRY:/}python:3.10-buster

Information

apiVersion: skaffold/v4beta6
kind: Config
metadata:
  name: dsp

build:
  artifacts:
    - context: ../dsp-test
      image: dsp-test
  local:
    push: false

Steps to reproduce the behavior

skaffold build

ericzzzzzzz commented 1 year ago

hey, cloud you try provide buildArg https://skaffold.dev/docs/references/yaml/#build-artifacts-docker-buildArgs in your skafffold.yaml? example: https://github.com/GoogleContainerTools/skaffold/blob/23c5c16b9fc777b87602aa27dcbe3136291959f3/examples/hot-reload/skaffold.yaml#L19-L21

mmx86 commented 1 year ago
apiVersion: skaffold/v4beta6
kind: Config
metadata:
  name: dsp

build:
  artifacts:
    - context: ../dsp-test
      docker:
        buildArgs:
          DOCKER_REGISTRY: nexus
      image: dsp-test
  local:
    push: false

logs:


» skaffold build                                                                                                                                                                          [c6b0d57]
Generating tags...
 - dsp-test -> dsp-test:v1.0.1-117-g5c5727d-dirty
Checking cache...
 - dsp-test: Error checking cache.
getting hash for artifact "dsp-test": getting dependencies for "dsp-test": parsing ONBUILD instructions: retrieving image "${DOCKER_REGISTRY:+nexus/}python:3.10-buster": parsing reference "${DOCKER_REGISTRY:+nexus/}python:3.10-buster": could not parse reference: ${DOCKER_REGISTRY:+nexus/}python:3.10-buster