GoogleContainerTools / GoogleContainerTools/skaffold

Docker image push always queries remote registry to get digest

Open
#9,967 1 comment 11 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Hi Skaffold team,

I’ve been digging into how digests are retrieved during the image push process and noticed some behavior that might be worth a look. In the `Push` function in `pkg/skaffold/docker/image.go`, digest is firstly attempted by retrieving from the docker daemon stream in `streamDockerMessages`, if no digest is found then it will try to query the remote registry. However, not sure if it is due to the evolution of docker, it seems that the steamed JSON messages don't contain the expected `Aux` field. For example I tried to log the messages sent from local docker:
```
{"status":"The push refers to repository [123456789.dkr.ecr.us-west-1.amazonaws.com/my-registry/app]"}
{"status":"Waiting","progressDetail":{},"id":"3b0b485a4ce3"}
{"status":"Waiting","progressDetail":{},"id":"02c0ea4dbd74"}
{"status":"Layer already exists","progressDetail":{},"id":"43afc70324ef"}
{"status":"Layer already exists","progressDetail":{},"id":"f627b8f9d75e"}
{"status":"Waiting","progressDetail":{},"id":"287854352814"}
{"status":"Layer already exists","progressDetail":{},"id":"07bbad0c9f20"}
{"status":"Layer already exists","progressDetail":{},"id":"d26345ad56db"}
...
{"status":"Pushing","progressDetail":{"current":1316,"total":1316},"id":"535081fbfe25"}
{"status":"Pushed","progressDetail":{},"id":"535081fbfe25"}
{"status":"app-g91cc1349d5-dirty: digest: sha256:1ea1567003d89d46b3592cd3efd2304262aec0a41f710dad208c5227d456fdb0 size: 856"}
```

As a result, the `Push` function always queries the remote registry (`RemoteDigest`) to get the digest.

I'd be happy to provide more logs or help test a fix if needed. Thanks for all the hard work on Skaffold!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.