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

feat: when pull_policy: never skip query manifests #124

Open
loynoir opened this issue Jul 8, 2022 · 0 comments
Open

feat: when pull_policy: never skip query manifests #124

loynoir opened this issue Jul 8, 2022 · 0 comments

Comments

@loynoir
Copy link

loynoir commented Jul 8, 2022

Given

Given some apps using different settings, but reference to same build local image.

version: "3.6"

networks:
  napp:

services:
  build:
    pull_policy: never
    image: private/image
    build:
      network: foobar
      context: foobar
      dockerfile: foobar.Dockerfile
      args:
        foo: bar
        bar: foo

  app1:
    depends_on:
      - build
    pull_policy: never
    image: private/image
    environment:
      - settings: A

  app2:
    depends_on:
      - build
    pull_policy: never
    image: private/image
    environment:
      - settings: B

Actual

failed to update image with err: 
failed to find digest for 'private/image' with err: 
GET https://index.docker.io/v2/library/private/image/manifests/latest: 
UNAUTHORIZED: authentication required; 
[map[Action:pull Class: Name:library/private/image Type:repository]

Expected

When pull_policy: never, skip query manifests.

Some thoughts

I think pull_policy: never can somehow indicate a local image.

  1. docker-compose pull will skip pull_policy: never section.
  2. Without pull_policy: never, docker-compose pull will fail on local images.
  3. The one who using local image, and want to use docker pull, have no choice but add pull_policy: never.

Current workaround

Move build section down to every else services.

If build sections have X lines, and being refer to Y times, becomes long long XY lines. 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant