Bug 2278652 - container=oci dropped in f40
Summary: container=oci dropped in f40
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora Container Images
Classification: Fedora
Component: fedora-container-image
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Clement Verna
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-05-02 15:29 UTC by Colin Walters
Modified: 2024-05-08 16:26 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-05-08 16:26:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Colin Walters 2024-05-02 15:29:11 UTC
$ skopeo inspect -n docker://quay.io/fedora/fedora:39 | jq .Env
[
  "DISTTAG=f39container",
  "FGC=f39",
  "container=oci"
]
$ skopeo inspect -n docker://quay.io/fedora/fedora:40 | jq .Env
null
$

Also

$ skopeo inspect -n docker://registry.access.redhat.com/ubi9/ubi:latest | jq .Env
[
  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "container=oci"
]

Comment 1 Colin Walters 2024-05-02 15:34:30 UTC
Specifically, there's a fair amount of tooling that checks for `container` being set.

Comment 2 Colin Walters 2024-05-02 16:46:43 UTC
I guess this is somewhat bike-sheddable as uptake of that environment variable hasn't been high.

Oh wait...interesting.  There's another wrinkle here, which is I think podman itself will auto-set the variable if it hasn't been set, but other container runtimes (e.g. at least cri-o as used by OCP) doesn't inherit this behavior.  And I think docker never did either.

Well...I guess arguably we could try to change everything to do the stanza of "check /run/.containerenv, check /.dockerenv".  But that's going to take some time to propagate with a pretty wide potential blast radius: https://github.com/search?q=getenv%28%22container%22%29&type=code

Comment 4 Clement Verna 2024-05-08 16:26:17 UTC
This is now fixed

 [cverna@laptop]  $ skopeo inspect -n docker://quay.io/fedora/fedora:rawhide | jq .Env
[
  "container=oci"
]
~
 [cverna@laptop]  $ skopeo inspect -n docker://quay.io/fedora/fedora:40 | jq .Env
[
  "container=oci"
]


Note You need to log in before you can comment on or make changes to this bug.