OC-IMAGE-EXTRACT(1)

πŸ“¦
version 4.22.0 Β· 2 versions
, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to OC IMAGE(1) β€” aka oc image extract(1) β€” from the Openshift CLI User Manuals, June 2016 edition. πŸ’–

oc image extract β€” Copy files from an image to the file system. periodt. πŸ’…


✨ SYNOPSIS ✨

oc image extract [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe is: extract the contents of an image to disk. πŸ’…

Download an image, or parts of an image, to the file system. This lets users access the contents of images without requiring a container runtime engine running. iconic, honestly.

Unless the --path flag is passed, image contents will be extracted into the current directory.

Pass images to extract as arguments. The --path flag lets you define multiple source to destination directory mappings. The source section may be either a file, a directory (ends with a /), or a file pattern within a directory. The destination section is a directory to extract to. Both source and destination must be specified. no cap.

If the specified image supports multiple operating systems, the image that matches the current operating system will be chosen. Otherwise you must pass --filter-by-os to select the desired image.

You may further qualify the image by adding a layer selector to the end of the image string to only extract specific layers within an image. The supported selectors are:

  • [<index> ] β€” select the layer at the provided index (zero-indexed)
  • [<from_index> ,<to_index> ] β€” select layers by index, exclusive
  • [ <prefix> ] β€” select the layer with the matching digest prefix or return an error

Negative indices are counted from the end of the list, e.g. [-1] selects the last layer.


πŸ’… OPTIONS πŸ’…

okay these are the main-character flags, bestie β€” every single one, no skipping:

  • --all-layers=false β€” For dry-run mode, process from lowest to highest layer and don't omit duplicate files.
  • --certificate-authority="" β€” The path to a certificate authority bundle to use when communicating with the managed container image registries. If --insecure is used, this flag will be ignored.
  • --confirm=false β€” Pass to allow extracting to non-empty directories.
  • --dir="" β€” The directory on disk that file:// images will be extracted from.
  • --dry-run=false β€” Print the actions that would be taken and exit without writing any contents.
  • --file=[] β€” Extract the specified files to the current directory.
  • --filter-by-os="" β€” A regular expression to control which images are considered when multiple variants are available. Images will be passed as '<platform>/<architecture>[/<variant>]'.
  • --idms-file="" β€” Path to an ImageDigestMirrorSet file. If set, data from this file will be used to find alternative locations for images.
  • --insecure=false β€” Allow push and pull operations to registries to be made over HTTP
  • --only-files=false β€” Only extract regular files and directories from the image.
  • --path=[] β€” Extract only part of an image, or, designate the directory on disk to extract image contents into. Must be SRC:DST where SRC is the path within the image and DST a local directory. If not specified the default is to extract everything to the current directory.
  • -p, --preserve-ownership=false β€” Preserve the permissions of extracted files.
  • -a, --registry-config="" β€” Path to your registry credentials. Alternatively REGISTRY_AUTH_FILE env variable can be also specified. Defaults to ${XDG_RUNTIME_DIR}/containers/auth.json, /run/containers/${UID}/auth.json, ${XDG_CONFIG_HOME}/containers/auth.json, ${DOCKER_CONFIG}, /.docker/config.json, /.dockercfg. The order can be changed via the REGISTRY_AUTH_PREFERENCE env variable (deprecated) with a "docker" value, which prioritizes Docker credentials over Podman's.
  • --skip-verification=false β€” Skip verifying the integrity of the retrieved content. This is not recommended, but may be necessary when importing images from older image registries. Only bypass verification if the registry is known to be trustworthy.

🧬 OPTIONS INHERITED FROM PARENT COMMANDS 🧬

these are the inherited flags β€” yes, they're still required info, bestie:

  • --as="" β€” Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
  • --as-group=[] β€” Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
  • --as-uid="" β€” UID to impersonate for the operation.
  • --as-user-extra=[] β€” User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key.
  • --cache-dir="/homeless-shelter/.kube/cache" β€” Default cache directory
  • --client-certificate="" β€” Path to a client certificate file for TLS
  • --client-key="" β€” Path to a client key file for TLS
  • --cluster="" β€” The name of the kubeconfig cluster to use
  • --context="" β€” The name of the kubeconfig context to use
  • --disable-compression=false β€” If true, opt-out of response compression for all requests to the server
  • --insecure-skip-tls-verify=false β€” If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
  • --kubeconfig="" β€” Path to the kubeconfig file to use for CLI requests.
  • --kuberc="" β€” Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.
  • --match-server-version=false β€” Require server version to match client version
  • -n, --namespace="" β€” If present, the namespace scope for this CLI request
  • --profile="none" β€” Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)
  • --profile-output="profile.pprof" β€” Name of the file to write the profile to
  • --request-timeout="0" β€” The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
  • -s, --server="" β€” The address and port of the Kubernetes API server
  • --tls-server-name="" β€” Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
  • --token="" β€” Bearer token for authentication to the API server
  • --user="" β€” The name of the kubeconfig user to use
  • --warnings-as-errors=false β€” Treat warnings received from the server as errors and exit with a non-zero exit code

🌈 EXAMPLE 🌈

these examples are giving "copy/paste and slay" β€” keep every line exactly as it is:

                # Extract the busybox image into the current directory
                oc image extract docker.io/library/busybox:latest

                # Extract the busybox image into a designated directory (must exist)
                oc image extract docker.io/library/busybox:latest --path /:/tmp/busybox

                # Extract the busybox image into the current directory for linux/s390x platform
                # Note: Wildcard filter is not supported with extract; pass a single os/arch to extract
                oc image extract docker.io/library/busybox:latest --filter-by-os=linux/s390x

                # Extract a single file from the image into the current directory
                oc image extract docker.io/library/centos:7 --path /bin/bash:.

                # Extract all .repo files from the image's /etc/yum.repos.d/ folder into the current directory
                oc image extract docker.io/library/centos:7 --path /etc/yum.repos.d/*.repo:.

                # Extract all .repo files from the image's /etc/yum.repos.d/ folder into a designated directory (must exist)
                # This results in /tmp/yum.repos.d/*.repo on local system
                oc image extract docker.io/library/centos:7 --path /etc/yum.repos.d/*.repo:/tmp/yum.repos.d

                # Extract an image stored on disk into the current directory ($(pwd)/v2/busybox/blobs,manifests exists)
                # --confirm is required because the current directory is not empty
                oc image extract file://busybox:local --confirm

                # Extract an image stored on disk in a directory other than $(pwd)/v2 into the current directory
                # --confirm is required because the current directory is not empty ($(pwd)/busybox-mirror-dir/v2/busybox exists)
                oc image extract file://busybox:local --dir busybox-mirror-dir --confirm

                # Extract an image stored on disk in a directory other than $(pwd)/v2 into a designated directory (must exist)
                oc image extract file://busybox:local --dir busybox-mirror-dir --path /:/tmp/busybox

                # Extract the last layer in the image
                oc image extract docker.io/library/centos:7[-1]

                # Extract the first three layers of the image
                oc image extract docker.io/library/centos:7[:3]

                # Extract the last three layers of the image
                oc image extract docker.io/library/centos:7[-3:]

🫢 SEE ALSO 🫢


πŸ“œ HISTORY πŸ“œ

June 2016, Ported from the Kubernetes man-doc generator


that's the whole page, bestie β€” source/version: Openshift CLI User Manuals, June 2016 βœ¨πŸ’…πŸ¦‹

πŸ“¦ where this page comes from