diff options
Diffstat (limited to 'recipes-containers')
| -rw-r--r-- | recipes-containers/vcontainer/README.md | 49 | ||||
| -rwxr-xr-x | recipes-containers/vcontainer/files/vcontainer-common.sh | 11 | ||||
| -rw-r--r-- | recipes-containers/vcontainer/vdkr-rootfs-image.bb | 1 |
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 | |||
| 268 | vdkr images # Shows alpine:latest | 268 | vdkr images # Shows alpine:latest |
| 269 | ``` | 269 | ``` |
| 270 | 270 | ||
| 271 | ## Registry Login and Configuration | ||
| 272 | |||
| 273 | For authenticated registries: | ||
| 274 | |||
| 275 | ```bash | ||
| 276 | # Login (interactive password prompt) | ||
| 277 | vdkr login --username myuser https://registry.example.com/ | ||
| 278 | |||
| 279 | # Pull from the registry | ||
| 280 | vdkr pull registry.example.com/myimage:latest | ||
| 281 | ``` | ||
| 282 | |||
| 283 | Set 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) | ||
| 287 | vdkr vconfig registry registry.example.com | ||
| 288 | |||
| 289 | # Now pulls try the default registry first, then Docker Hub | ||
| 290 | vdkr pull myimage:latest | ||
| 291 | |||
| 292 | # One-off override without changing the default | ||
| 293 | vdkr --registry other.registry.com pull myimage:latest | ||
| 294 | |||
| 295 | # Clear default registry | ||
| 296 | vdkr vconfig registry --reset | ||
| 297 | ``` | ||
| 298 | |||
| 299 | **Note:** The `--registry` flag is a vdkr option that sets the default | ||
| 300 | registry for pulls. For `login`, pass the registry URL as a positional | ||
| 301 | argument after the login flags: | ||
| 302 | |||
| 303 | ```bash | ||
| 304 | # Correct: | ||
| 305 | vdkr login --username myuser https://registry.example.com/ | ||
| 306 | |||
| 307 | # Wrong (--registry is consumed by vdkr, login gets no URL): | ||
| 308 | vdkr --registry https://registry.example.com/ login --username myuser | ||
| 309 | ``` | ||
| 310 | |||
| 311 | **TLS certificates:** The vdkr/vpdmn rootfs images include common | ||
| 312 | intermediate certificates (Let's Encrypt E8/R11) to handle registries | ||
| 313 | that don't send the full certificate chain. For self-signed registries, | ||
| 314 | use `--secure-registry --ca-cert`: | ||
| 315 | |||
| 316 | ```bash | ||
| 317 | vdkr --secure-registry --ca-cert /path/to/ca.crt pull myimage | ||
| 318 | ``` | ||
| 319 | |||
| 271 | ## Volume Mounts | 320 | ## Volume Mounts |
| 272 | 321 | ||
| 273 | Mount host directories into containers using `-v` (requires memory resident mode): | 322 | Mount 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 |
