Skip to content

Commit b692c2b

Browse files
Merge pull request #42 from containers/inspect-quick-example
doc(inspect): add inspect to quick example
2 parents 1228925 + f3fed32 commit b692c2b

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ print(
2828
f"Digest for {str(my_image)}: " + \
2929
my_image.get_digest(auth={}) # sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07
3030
)
31+
32+
# Inspect the container image image for a more consolidated summary
33+
print(
34+
f"Inspect for {str(my_image)}:\n" + \
35+
str(my_image.inspect(auth={})) # Same as skopeo inspect docker://registry.k8s.io/pause:3.5
36+
)
3137
```
3238

3339
To run this example, simply execute the following from the root of this repository

doc/source/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Here is a quick motivating example for how you might use ``containerimage-py`` i
3737
my_image.get_digest(auth={}) # sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07
3838
)
3939
40+
# Inspect the container image image for a more consolidated summary
41+
print(
42+
f"Inspect for {str(my_image)}:\n" + \
43+
str(my_image.inspect(auth={})) # Same as skopeo inspect docker://registry.k8s.io/pause:3.5
44+
)
45+
4046
Installation
4147
============
4248

examples/quick-example.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from image.containerimage import ContainerImage
1818

1919
# Initialize a ContainerImage given a tag reference
20-
my_image = ContainerImage("registry.k8s.io/pause:3.5")
20+
my_image = ContainerImage("ghcr.io/matejvasek/builder-ubi8-base:latest")
2121

2222
# Display some basic information about the container image
2323
print(
@@ -28,3 +28,9 @@
2828
f"Digest for {str(my_image)}: " + \
2929
my_image.get_digest(auth={}) # sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07
3030
)
31+
32+
# Inspect the container image image for a more consolidated summary
33+
print(
34+
f"Inspect for {str(my_image)}:\n" + \
35+
str(my_image.inspect(auth={})) # Same as skopeo inspect docker://registry.k8s.io/pause:3.5
36+
)

0 commit comments

Comments
 (0)