Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not looking for local images #1158

Open
milouk opened this issue Mar 22, 2024 · 1 comment
Open

Not looking for local images #1158

milouk opened this issue Mar 22, 2024 · 1 comment
Labels
elaborate Further elaboration is needed

Comments

@milouk
Copy link

milouk commented Mar 22, 2024

Minimal .gitlab-ci.yml illustrating the issue

build backend-release:
  image:
    name: "gcr.io/kaniko-project/executor:v1.8.1-debug"
    entrypoint: [""]
  tags:
    - "docker_build"
  stage: build
  variables:
    BUILD_DOCKERFILE_DIR: "app/"
    BUILD_IMAGE_NAME: "app-release"
    BUILD_IMAGE_TAG: "$REGISTRY_URL/$REGISTRY_PROJECT/$BUILD_IMAGE_NAME:$CI_COMMIT_SHORT_SHA"
  before_script:
    - echo "{\"auths\":{\"${REGISTRY_URL}\":{\"username\":\"$DOCKER_REGISTRY_USER\", \"password\":\"$DOCKER_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
  script:
    - /kaniko/executor --no-push --context $BUILD_DOCKERFILE_DIR --destination $BUILD_IMAGE_TAG --build-arg GIT_COMMIT=$CI_COMMIT_SHORT_SHA --dockerfile $BUILD_DOCKERFILE_DIR/Dockerfile --cache=false --target production --skip-unused-stages

Expected behavior
My Dockerfile includes the following line:

COPY --from=registry.docker.mycompany.com/app/mybinary:v1 /tmp/dist/ /tmp/dist/

I don't have pull access to registry.docker.mycompany.com however, i have the image locally in my pc.
I would expect instead of trying to fetch remotely first, to search locally for an image with a matching tag

Host information
MacOS M1
gitlab-ci-local 4.46.1

Containerd binary
docker

@firecow
Copy link
Owner

firecow commented Mar 22, 2024

Does gitlab.com search on their shared runners for the image locally instead of pulling it from remote?

@firecow firecow added the elaborate Further elaboration is needed label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elaborate Further elaboration is needed
Projects
None yet
Development

No branches or pull requests

2 participants