0
# Manifest Management
1
2
Docker manifest list management for multi-architecture image support. Manifests enable creating and managing platform-specific image variants, allowing a single image name to reference different implementations for different architectures and operating systems.
3
4
## Capabilities
5
6
### Manifest Creation
7
8
Create manifest lists that reference multiple platform-specific images.
9
10
```python { .api }
11
def create(
12
name: str,
13
manifests: List[str],
14
*,
15
amend: bool = False,
16
insecure: bool = False
17
) -> ManifestList:
18
"""
19
Create a manifest list.
20
21
Parameters:
22
- name: Name for the manifest list
23
- manifests: List of manifest/image references to include
24
- amend: Modify existing manifest list if it exists
25
- insecure: Allow insecure registry connections
26
27
Returns:
28
ManifestList object
29
"""
30
```
31
32
### Manifest Annotation
33
34
Annotate manifests with platform-specific metadata.
35
36
```python { .api }
37
def annotate(
38
name: str,
39
manifest: str,
40
*,
41
arch: Optional[str] = None,
42
os: Optional[str] = None,
43
os_features: Optional[List[str]] = None,
44
os_version: Optional[str] = None,
45
variant: Optional[str] = None
46
) -> None:
47
"""
48
Annotate a manifest with platform information.
49
50
Parameters:
51
- name: Manifest list name
52
- manifest: Manifest to annotate
53
- arch: Architecture (e.g., amd64, arm64, arm, 386)
54
- os: Operating system (e.g., linux, windows, darwin)
55
- os_features: OS features list
56
- os_version: OS version
57
- variant: Architecture variant (e.g., v6, v7, v8 for ARM)
58
"""
59
```
60
61
### Manifest Inspection
62
63
Inspect manifest list details and constituent manifests.
64
65
```python { .api }
66
def inspect(x: Union[str, ManifestList]) -> ManifestList:
67
"""
68
Inspect a manifest list.
69
70
Parameters:
71
- x: Manifest list name or ManifestList object
72
73
Returns:
74
ManifestList object with detailed information
75
"""
76
```
77
78
### Manifest Publishing
79
80
Push manifest lists to registries.
81
82
```python { .api }
83
def push(
84
x: Union[str, ManifestList],
85
*,
86
purge: bool = False,
87
quiet: bool = False
88
) -> None:
89
"""
90
Push manifest list to registry.
91
92
Parameters:
93
- x: Manifest list name or ManifestList object
94
- purge: Remove local manifest list after push
95
- quiet: Suppress progress output
96
"""
97
```
98
99
### Manifest Removal
100
101
Remove manifest lists from local storage.
102
103
```python { .api }
104
def remove(manifest_lists: Union[str, List[str]]) -> None:
105
"""
106
Remove one or more manifest lists.
107
108
Parameters:
109
- manifest_lists: Manifest list name(s) to remove
110
"""
111
```
112
113
**Usage Examples:**
114
115
```python
116
from python_on_whales import docker
117
118
# First, build and push platform-specific images
119
# docker buildx build --platform linux/amd64 -t myapp:amd64 --push .
120
# docker buildx build --platform linux/arm64 -t myapp:arm64 --push .
121
# docker buildx build --platform linux/arm/v7 -t myapp:armv7 --push .
122
123
# Create manifest list
124
manifest = docker.manifest.create(
125
"myregistry.com/myapp:latest",
126
[
127
"myregistry.com/myapp:amd64",
128
"myregistry.com/myapp:arm64",
129
"myregistry.com/myapp:armv7"
130
]
131
)
132
133
# Annotate manifests with platform info
134
docker.manifest.annotate(
135
"myregistry.com/myapp:latest",
136
"myregistry.com/myapp:amd64",
137
arch="amd64",
138
os="linux"
139
)
140
141
docker.manifest.annotate(
142
"myregistry.com/myapp:latest",
143
"myregistry.com/myapp:arm64",
144
arch="arm64",
145
os="linux"
146
)
147
148
docker.manifest.annotate(
149
"myregistry.com/myapp:latest",
150
"myregistry.com/myapp:armv7",
151
arch="arm",
152
os="linux",
153
variant="v7"
154
)
155
156
# Inspect manifest list
157
manifest_details = docker.manifest.inspect("myregistry.com/myapp:latest")
158
print(f"Manifest: {manifest_details.name}")
159
print(f"Schema Version: {manifest_details.schema_version}")
160
for i, m in enumerate(manifest_details.manifests):
161
print(f" Platform {i+1}: {m.platform.architecture}/{m.platform.os}")
162
163
# Push manifest list to registry
164
docker.manifest.push("myregistry.com/myapp:latest")
165
166
# Remove local manifest list
167
docker.manifest.remove("myregistry.com/myapp:latest")
168
```
169
170
## Types
171
172
```python { .api }
173
class ManifestList:
174
name: str
175
schema_version: int
176
media_type: str
177
manifests: List[ManifestDescriptor]
178
179
def remove(self) -> None:
180
"""Remove this manifest list."""
181
182
class ManifestDescriptor:
183
media_type: str
184
size: int
185
digest: str
186
platform: Platform
187
188
class Platform:
189
architecture: str
190
os: str
191
os_version: Optional[str]
192
os_features: Optional[List[str]]
193
variant: Optional[str]
194
features: Optional[List[str]]
195
```