Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC #0096] Lifecycle should detect Target OS from etc/os-release #1033

Closed
Tracked by #219
joe-kimmel-vmw opened this issue Mar 9, 2023 · 3 comments · Fixed by #1053 or #1050
Closed
Tracked by #219

[RFC #0096] Lifecycle should detect Target OS from etc/os-release #1033

joe-kimmel-vmw opened this issue Mar 9, 2023 · 3 comments · Fixed by #1053 or #1050
Labels

Comments

@joe-kimmel-vmw
Copy link
Contributor

Description

as part of the "stack removal" work we are adding the Target metadata, which is more specific information about the OS. Already through the work in #743 and #742 we pull this data from the Run Image OCI artifact metadata, however we can also pull it from the filesystem of the run image.

Proposed solution

According to the internet:

The /etc/os-release and /usr/lib/os-release files contain operating system identification data. The format of os-release is a newline-separated list of environment-like shell-compatible variable assignments.

Therefore in cases where there is no metadata from the RunImage available we should also try to infer from the filesystem. If the runImage has the metadata then we will not check the file system information.

Describe alternatives you've considered

Additional context

@jabrown85 jabrown85 changed the title Lifecycle should detect Target OS from etc/os-release [RFC #0096] Lifecycle should detect Target OS from etc/os-release Mar 23, 2023
@joe-kimmel-vmw
Copy link
Contributor Author

@joe-kimmel-vmw
Copy link
Contributor Author

three examples:

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
NAME="Fedora Linux"
VERSION="37 (Cloud Edition)"
ID=fedora
VERSION_ID=37
VERSION_CODENAME=""
PLATFORM_ID="platform:f37"
PRETTY_NAME="Fedora Linux 37 (Cloud Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:37"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=37
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=37
VARIANT="Cloud Edition"
VARIANT_ID=cloud

@robdimsdale
Copy link

robdimsdale commented May 10, 2023

Also, just for posterity, this is the contents of the jammy base stack's build image's /etc/os-release:

SUPPORT_URL="https://github.com/paketo-buildpacks/jammy-base-stack/blob/main/README.md"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
NAME="Ubuntu"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://github.com/paketo-buildpacks/jammy-base-stack"
BUG_REPORT_URL="https://github.com/paketo-buildpacks/jammy-base-stack/issues/new"
PRETTY_NAME="Paketo Buildpacks Base Jammy"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants