Vincenzo
Vincenzo

Reputation: 6448

parsing skaffold config: profile selection ["linux/amd64" "linux/arm64"] did not match those defined in any configurations

I'm building a CI pipeline in GitLab, to create a multi-platform docker image and push it in the repo's container registry. For the job I'm using image: gcr.io/k8s-skaffold/skaffold:v2.13.2, in my before_script i login into the registry - docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD and in the script i run - skaffold build -p=linux/amd64,linux/arm64 --default-repo=$CI_REGISTRY/myProject/myRepo.

stages:
  - build
  - master
  - dev


build_dev:
  stage: dev
  image:
    name: gcr.io/k8s-skaffold/skaffold:v2.13.2

  variables:
    IMAGE_TAG: dev
    IMAGE_NAME: image-name:$IMAGE_TAG

  before_script:
    - docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD

  script:
    - skaffold build -p=linux/amd64,linux/arm64 --default-repo=$CI_REGISTRY/project-name//repo-name --push=true
  only:
    - dev

The pipeline fails as linux/amd64,linux/arm64 are not matching any valid definition and the jobs' log is:

parsing skaffold config: profile selection ["linux/amd64" "linux/arm64"] did not match those defined in any configurations. Check that values specified in the "--profile" or "-p" flags are valid profile names.

In my code I have a skaffold.yaml file

apiVersion: skaffold/v2alpha3
kind: Config
build:
  local:
    push: true
  artifacts:
    - image: registry.gitlab.com/project-name/repo-name
      context: ./
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: '**/*.js'
            dest: .
  tagPolicy:
    envTemplate:
      # template: '{{.SERVER_LATEST_IMAGE_TAG}}'
      template: '{{.SERVER_DEV_IMAGE_TAG}}'

and in my MacBook from the cli I can run the command skaffold build --platform linux/amd64,linux/arm64and it does create a multi-arch image and upload it to the repo container registry. In Skaffold docs I do see those definitions as still valid. Can you see what I'm doing wrong in the pipeline definition? Many thanks

Upvotes: 0

Views: 58

Answers (0)

Related Questions