summaryrefslogtreecommitdiffstats
path: root/recipes-containers/vcontainer
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/vcontainer')
-rw-r--r--recipes-containers/vcontainer/README.md49
-rwxr-xr-xrecipes-containers/vcontainer/files/vcontainer-common.sh11
-rw-r--r--recipes-containers/vcontainer/vdkr-rootfs-image.bb1
3 files changed, 58 insertions, 3 deletions
diff --git a/recipes-containers/vcontainer/README.md b/recipes-containers/vcontainer/README.md
index 76d54d18..657dd02e 100644
--- a/recipes-containers/vcontainer/README.md
+++ b/recipes-containers/vcontainer/README.md
@@ -268,6 +268,55 @@ vdkr pull alpine:latest
268vdkr images # Shows alpine:latest 268vdkr images # Shows alpine:latest
269``` 269```
270 270
271## Registry Login and Configuration
272
273For authenticated registries:
274
275```bash
276# Login (interactive password prompt)
277vdkr login --username myuser https://registry.example.com/
278
279# Pull from the registry
280vdkr pull registry.example.com/myimage:latest
281```
282
283Set a default registry so you don't need to specify the full URL each time:
284
285```bash
286# Set default registry (persisted across sessions)
287vdkr vconfig registry registry.example.com
288
289# Now pulls try the default registry first, then Docker Hub
290vdkr pull myimage:latest
291
292# One-off override without changing the default
293vdkr --registry other.registry.com pull myimage:latest
294
295# Clear default registry
296vdkr vconfig registry --reset
297```
298
299**Note:** The `--registry` flag is a vdkr option that sets the default
300registry for pulls. For `login`, pass the registry URL as a positional
301argument after the login flags:
302
303```bash
304# Correct:
305vdkr login --username myuser https://registry.example.com/
306
307# Wrong (--registry is consumed by vdkr, login gets no URL):
308vdkr --registry https://registry.example.com/ login --username myuser
309```
310
311**TLS certificates:** The vdkr/vpdmn rootfs images include common
312intermediate certificates (Let's Encrypt E8/R11) to handle registries
313that don't send the full certificate chain. For self-signed registries,
314use `--secure-registry --ca-cert`:
315
316```bash
317vdkr --secure-registry --ca-cert /path/to/ca.crt pull myimage
318```
319
271## Volume Mounts 320## Volume Mounts
272 321
273Mount host directories into containers using `-v` (requires memory resident mode): 322Mount host directories into containers using `-v` (requires memory resident mode):
diff --git a/recipes-containers/vcontainer/files/vcontainer-common.sh b/recipes-containers/vcontainer/files/vcontainer-common.sh
index c7160860..d5637c9e 100755
--- a/recipes-containers/vcontainer/files/vcontainer-common.sh
+++ b/recipes-containers/vcontainer/files/vcontainer-common.sh
@@ -2196,9 +2196,14 @@ case "$COMMAND" in
2196 2196
2197 login) 2197 login)
2198 [ "${VCONTAINER_HYPERVISOR:-}" = "xen" ] && vxn_unsupported "login" 2198 [ "${VCONTAINER_HYPERVISOR:-}" = "xen" ] && vxn_unsupported "login"
2199 # Login to registry - may need credentials via stdin 2199 # Login needs interactive stdin for password prompt.
2200 # For non-interactive: runtime login -u user -p pass registry 2200 # Use daemon-interactive mode (same as vshell/exec -it).
2201 run_runtime_command "$VCONTAINER_RUNTIME_CMD login ${COMMAND_ARGS[*]}" 2201 if daemon_is_running; then
2202 RUNNER_ARGS=$(build_runner_args)
2203 "$RUNNER" $RUNNER_ARGS --daemon-interactive -- "$VCONTAINER_RUNTIME_CMD login ${COMMAND_ARGS[*]}"
2204 else
2205 run_runtime_command "$VCONTAINER_RUNTIME_CMD login ${COMMAND_ARGS[*]}"
2206 fi
2202 ;; 2207 ;;
2203 2208
2204 logout) 2209 logout)
diff --git a/recipes-containers/vcontainer/vdkr-rootfs-image.bb b/recipes-containers/vcontainer/vdkr-rootfs-image.bb
index 64054376..fb5a3718 100644
--- a/recipes-containers/vcontainer/vdkr-rootfs-image.bb
+++ b/recipes-containers/vcontainer/vdkr-rootfs-image.bb
@@ -60,6 +60,7 @@ IMAGE_INSTALL = " \
60 iptables \ 60 iptables \
61 util-linux \ 61 util-linux \
62 kernel-modules \ 62 kernel-modules \
63 ca-certificates \
63" 64"
64 65
65# No extra features needed 66# No extra features needed