Skip to content

feat: demonstrate a replacement for go_image#77

Merged
alexeagle merged 2 commits intomainfrom
go_example
Feb 24, 2023
Merged

feat: demonstrate a replacement for go_image#77
alexeagle merged 2 commits intomainfrom
go_example

Conversation

@alexeagle
Copy link
Copy Markdown
Collaborator

No description provided.

@alexeagle alexeagle requested a review from thesayyn February 24, 2023 22:15
Copy link
Copy Markdown
Collaborator

@thesayyn thesayyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@alexeagle alexeagle merged commit 27b6aef into main Feb 24, 2023
@alexeagle alexeagle deleted the go_example branch February 24, 2023 23:26
Comment on lines +47 to +49
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
image = "gcr.io/distroless/base",
platforms = ["linux/amd64","linux/arm64"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run the following command, I see different digests for the AMD64 and ARM64 images:

docker manifest inspect gcr.io/distroless/base \
  | jq --raw-output \
       '.manifests[] | select(.platform.os == "linux") | {arch: .platform.architecture, digest}'

What allows you to specify one digest here and assume that the resulting image will work for both of these machine architectures?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crane has a digest command that lets you query the digest by running crane digest <IMAGE>. alternatively, you could specify tag and reproducible = False attributes and replace the attributes according to the warning message oci_pull will print.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all makes more sense to me today. With Using a combination of crane digest, docker manifest inspect, and GCP's Web console to inspect the GCR entries, I now see how we're able to point at an image that contains a manifest list, with several entries, each for a different combination of operating system and machine architecture.

With the docker manifest inspect command, it's not possible—or at least I couldn't figure out a way—to see the image digest for the image nominated by the tagged name. It dumps the manifest list, but doesn't tell you the digest of the image containing that manifest list. Using the crane digest command closes that gap.

Thank you for the suggestion, @thesayyn.

alexeagle pushed a commit that referenced this pull request Mar 12, 2023
The file list of c-ares 1.15.0 is used for 1.16.1 since the following files are
the same:
1. modules/c-ares/1.16.1/patches/add_build_file.patch
2. modules/c-ares/1.15.0/patches/add_build_file.patch

And add_build_file.patch is adapted from
https://github.com/grpc/grpc/tree/master/third_party/cares. I have tried to find
c-ares version 1.16.1 in grpc project. A search of grpc project commit log shows
that the most relevant thing is commit bdb3f860649bb4c136ba36bad3d9363fccbd29fa
which mentions '-DgRPC_CARES_PROVIDER=package with c-ares 1.16.0 overrides'. My
guess is that grpc has upgraded c-ares from 1.15.0 to 1.17.2 directly.

I built c-ares 1.16.1 with `buildconf` on macOS. The resulted Makefile has
the following two file list:
1. CSOURCES: C++ source files.
2. HHEADERS: C++ header files.

A comparison of CSOURCES with cc_library srcs attribute shows that some source
files are missing. ares_getopt.c is unneeded ares_getopt is not include in
CSOURCES. It is included in SAMPLESOURCES. So this commit deletes it. This
commit also adds the missing C++ source files.

A comparison of HHEADERS with cc_library hdrs attribute shows that hdrs has
three extra files:
1. ares_config.h
2. config-win32.h
3. ares_getopt.h

ares_getopt.h will be deleted together with ares_getopt.c. Since I am not sure of
the reason why the other two files exist, they are kept untouched.

Fix #77

update

update
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

Successfully merging this pull request may close these issues.

3 participants