You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adr-003-docker-image-download.md
+92-6Lines changed: 92 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,13 +65,15 @@ graph TD
65
65
A1[Simulated Fetching Logic]
66
66
A2[Basic Image Listing]
67
67
A3[Placeholder Pull Function]
68
+
A4[Load Images from .tar Files]
69
+
A5[Run Locally Loaded Images]
70
+
A6[Manifest Parsing]
68
71
end
69
72
70
73
%% Intermediate Stage
71
74
subgraph Intermediate
72
75
B1[Registry Interface Implementation]
73
-
B2[Manifest Parsing]
74
-
B3[Layer Downloading]
76
+
B2[Layer Downloading]
75
77
end
76
78
77
79
%% End Goal
@@ -85,8 +87,7 @@ graph TD
85
87
%% Connections
86
88
A --> B1
87
89
B1 --> B2
88
-
B2 --> B3
89
-
B3 --> C1
90
+
B2 --> C1
90
91
C1 --> C2
91
92
C2 --> C3
92
93
C3 --> C4
@@ -98,10 +99,12 @@ graph TD
98
99
- Simulated fetching logic is used to mimic image downloads.
99
100
- Basic image listing functionality is implemented.
100
101
- The `Pull` function exists as a placeholder without real registry interaction.
102
+
- Added support for loading images from `.tar` files.
103
+
- Added functionality to run locally loaded images.
104
+
- Manifest parsing is now part of the current stage.
101
105
102
106
2.**Intermediate Stage**:
103
107
- Introduce a `Registry` interface to abstract interactions with container registries.
104
-
- Implement manifest parsing to identify required layers.
105
108
- Add functionality for downloading image layers from registries.
106
109
107
110
3.**End Goal**:
@@ -110,6 +113,88 @@ graph TD
110
113
- Extract layers to create a functional root filesystem for containers.
111
114
- Achieve compatibility with real Docker workflows.
112
115
116
+
## Updates: Local Registry and Tar Functionality
117
+
118
+
### Local Registry Support
119
+
We added support for pulling images from a local registry. The `run` command now parses the registry URL directly from the image name. For example:
120
+
121
+
```bash
122
+
./basic-docker run localhost:5000/alpine /bin/sh -c "echo Hello from local registry"
123
+
```
124
+
125
+
This allows users to specify images hosted on a local registry (e.g., `localhost:5000`) or any custom registry URL.
126
+
127
+
### Tar File Loading
128
+
We also implemented functionality to load images from `.tar` files. This is useful for offline environments or pre-packaged images. The `load` command can be used as follows:
129
+
130
+
```bash
131
+
./basic-docker load alpine.tar
132
+
```
133
+
134
+
After loading, the image can be verified using the `images` command:
135
+
136
+
```bash
137
+
./basic-docker images
138
+
```
139
+
140
+
The output will include the image name, size, and whether its content is verified.
141
+
142
+
### Example Workflow
143
+
1.**Load an Image from a Tar File**:
144
+
```bash
145
+
./basic-docker load busyboximage.tar
146
+
```
147
+
Output:
148
+
```
149
+
Loading image from 'busyboximage.tar'...
150
+
Image 'busyboximage' loaded successfully.
151
+
```
152
+
153
+
Create the registry
154
+
155
+
$ docker run -d -p 5000:5000 --name registry registry:2
0 commit comments