docker-lock
docker-lock copied to clipboard
feat: when `pull_policy: never` skip query manifests
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.
-
docker-compose pullwill skippull_policy: neversection. - Without
pull_policy: never,docker-compose pullwill fail on local images. - The one who using local image, and want to use
docker pull, have no choice but addpull_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. 😭