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
{{ message }}
Repository navigation
oras push: support streamed uploading from stdin #1200
Regarding the user experience, here are some to-be-settled designs we need to think of:
How should user provide the name of the blob from stdin?
Besides from tar -c ...., what are the possible commands that can generate the to-be-uploaded stdin? (Asking since oras push <artifact> <folder> can already natively tar and upload the <folder> without invoking tar)
The following script is a real world example where streaming could come in handy.
Background
We fully manage the life cycle of an OpenShift cluster via a GitLab Pipeline. When creating a cluster with the openshift-install tool some files like terraform state and kube-configs will be created. Those files are needed during the whole life cycle of the cluster (not only in the current pipeline), thus they need to be stored persistently. In our case we use the existing GitLab registry and oras to create an image.
This way there is no need to create a temporary file and make sure to be in the correct directory in order to include the file without an absolute path which would make the image unable to unpack in other environments (OSs).
Hi @guettli , per our slack communication, I just assigned this issue to you. I look forward to working with you to get this feature request supported in ORAS. Let me know if anything that I could help. Thanks
I was just writing to be willing to take it, but as I am unsure when I have time for it, this may be the best solution. A few things I thought about:
My approach would be to specially handle the file name - as stdin and it could only be specified once (alongside other files from the filesystem). The default file name in the container image would be ./stdin.bin but it could be changed (including the path) with the @ suffix (e.g. -@/absolute/path/to/file.json or -@relative/path/to/file.txt:application/vnd.me.file).
As this is coupled with the issue #346 I would develop that in a way it would support also containers with multiple files. The command oras pull could then support selecting files to pull as argument similar to tar -x file/one.txt file/two.txt. If no files are given, all would be extracted and if there is only one the stdout would be a valid destination, otherwise one file must be selected via the args.
If this is an acceptable approach, I would also comment it to the corresponding issue.
I'd like to take this. The library side is now in place: oras-go v3.0.0 ships content.UnsafePusher (#1616, #1620, #1636, #1637 and #1647 in oras-go, which I wrote), so the CLI can stream stdin to a registry or OCI layout and compute the digest and size while writing. My plan, with a working branch:
oras push <ref> [files...] - reads one file from stdin. It's named with --stdin-name <name> or a title annotation for "-" in --annotation-file, which answers the naming question raised above; there's no silent default, since an untitled layer would be skipped by oras pull. A custom media type is given as -:<type>, which needs -- first because pflag reads -: as a flag.
oras blob push <ref> - no longer requires --size or a digest. A supplied digest is still verified.
Limits for now: no live progress bar in TTY mode for the stdin layer, and oras-go's 4 GiB MaxUnsafePushBytes default.
Does that UX work for you, or would you prefer a default name such as stdin.bin (as suggested above) over requiring one?
Superseded by #2409, which restates this request with an evaluation of the current state (oras-go v3 UnsafePusher) and a proposed UX and plan. Please continue the discussion there.
Activity
qweeah commentedon Dec 11, 2023
Regarding the user experience, here are some to-be-settled designs we need to think of:
tar -c ...., what are the possible commands that can generate the to-be-uploaded stdin? (Asking sinceoras push <artifact> <folder>can already natively tar and upload the<folder>without invokingtar)ProbstDJakob commentedon Dec 11, 2023
The following script is a real world example where streaming could come in handy.
Background
We fully manage the life cycle of an OpenShift cluster via a GitLab Pipeline. When creating a cluster with the
openshift-installtool some files like terraform state and kube-configs will be created. Those files are needed during the whole life cycle of the cluster (not only in the current pipeline), thus they need to be stored persistently. In our case we use the existing GitLab registry and oras to create an image.Current way to push the artifacts to the registry
Possible way to push the artifacts to the registry with pipelining
This way there is no need to create a temporary file and make sure to be in the correct directory in order to include the file without an absolute path which would make the image unable to unpack in other environments (OSs).
Counterpart
See #346 (comment)
guettli commentedon Jun 2, 2025
I am interested in that, too.
FeynmanZhou commentedon Jun 5, 2025
Pipelining the stin into
oras pushsounds like a common scenario now. Thanks @guettli @ProbstDJakob for sharing your use cases.@guettli or @ProbstDJakob are you interested in contributing to this feature?
FeynmanZhou commentedon Jun 9, 2025
Hi @guettli , per our slack communication, I just assigned this issue to you. I look forward to working with you to get this feature request supported in ORAS. Let me know if anything that I could help. Thanks
ProbstDJakob commentedon Jun 9, 2025
I was just writing to be willing to take it, but as I am unsure when I have time for it, this may be the best solution. A few things I thought about:
My approach would be to specially handle the file name
-as stdin and it could only be specified once (alongside other files from the filesystem). The default file name in the container image would be./stdin.binbut it could be changed (including the path) with the@suffix (e.g.-@/absolute/path/to/file.jsonor-@relative/path/to/file.txt:application/vnd.me.file).As this is coupled with the issue #346 I would develop that in a way it would support also containers with multiple files. The command
oras pullcould then support selecting files to pull as argument similar totar -x file/one.txt file/two.txt. If no files are given, all would be extracted and if there is only one the stdout would be a valid destination, otherwise one file must be selected via the args.If this is an acceptable approach, I would also comment it to the corresponding issue.
guettli commentedon May 7, 2026
I never asigned myself to the task, and I found no way to unasign me...
BTW afaik
regctlcan do streamed uploading.ShravanthReddy commentedon Nov 11, 2026
I'd like to take this. The library side is now in place: oras-go v3.0.0 ships
content.UnsafePusher(#1616, #1620, #1636, #1637 and #1647 in oras-go, which I wrote), so the CLI can stream stdin to a registry or OCI layout and compute the digest and size while writing. My plan, with a working branch:oras push <ref> [files...] -reads one file from stdin. It's named with--stdin-name <name>or a title annotation for"-"in--annotation-file, which answers the naming question raised above; there's no silent default, since an untitled layer would be skipped byoras pull. A custom media type is given as-:<type>, which needs--first because pflag reads-:as a flag.oras blob push <ref> -no longer requires--sizeor a digest. A supplied digest is still verified.MaxUnsafePushBytesdefault.Does that UX work for you, or would you prefer a default name such as
stdin.bin(as suggested above) over requiring one?TerryHowe commentedon Nov 28, 2026
Superseded by #2409, which restates this request with an evaluation of the current state (oras-go v3
UnsafePusher) and a proposed UX and plan. Please continue the discussion there.