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

Os not set #2225

Closed
vertti opened this issue Mar 14, 2020 · 5 comments
Closed

Os not set #2225

vertti opened this issue Mar 14, 2020 · 5 comments

Comments

@vertti
Copy link

vertti commented Mar 14, 2020

Description

podman build produces images that when inspected show Os field as empty "" instead of expected linux.

OpenShift refuses to run these containers and prints out:

Image operating system mismatch: image uses "", expecting "linux"

Steps to reproduce the issue:

  1. Use Dockerfile like:
FROM node:12-buster

ADD package.json .
  1. run podman build -t website .
  2. run podman inspect website

Describe the results you received:

Check Os field in the output. It's "" instead of "linux"

Describe the results you expected:

Check Os field in the output. It's "" instead of "linux"
Running for example podman inspect node:12-buster will show "Os": "linux",

Output of rpm -q buildah or apt list buildah:

buildah/unknown 1.14.2~1 amd64
buildah/unknown 1.14.2~1 arm64
buildah/unknown 1.14.2~1 armhf

Output of buildah version:

Version:         1.14.2
Go Version:      go1.12.10
Image Spec:      1.0.1-dev
Runtime Spec:    1.0.1-dev
CNI Spec:        0.4.0
libcni Version:  
image Version:   5.2.1
Git Commit:      
Built:           Wed Mar  4 16:29:04 2020
OS/Arch:         linux/amd64

Output of podman version if reporting a podman build issue:

Version:            1.8.1
RemoteAPI Version:  1
Go Version:         go1.12.10
OS/Arch:            linux/amd64

Output of cat /etc/*release:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.10
DISTRIB_CODENAME=eoan
DISTRIB_DESCRIPTION="Ubuntu 19.10"
NAME="Ubuntu"
VERSION="19.10 (Eoan Ermine)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.10"
VERSION_ID="19.10"
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=eoan
UBUNTU_CODENAME=eoan

Output of uname -a:

Linux vertin-x1 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Output of cat /etc/containers/storage.conf:

# This file is is the configuration file for all tools
# that use the containers/storage library.
# See man 5 containers-storage.conf for more information
# The "container storage" table contains all of the server options.
[storage]

# Default Storage Driver
driver = ""

# Temporary storage location
runroot = "/var/run/containers/storage"

# Primary Read/Write location of container storage
graphroot = "/var/lib/containers/storage"

[storage.options]
# Storage options to be passed to underlying storage drivers

# AdditionalImageStores is used to pass paths to additional Read/Only image stores
# Must be comma separated list.
additionalimagestores = [
]

# Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of
# a container, to the UIDs/GIDs as they should appear outside of the container,
# and the length of the range of UIDs/GIDs.  Additional mapped sets can be
# listed and will be heeded by libraries, but there are limits to the number of
# mappings which the kernel will allow when you later attempt to run a
# container.
#
# remap-uids = 0:1668442479:65536
# remap-gids = 0:1668442479:65536

# Remap-User/Group is a user name which can be used to look up one or more UID/GID
# ranges in the /etc/subuid or /etc/subgid file.  Mappings are set up starting
# with an in-container ID of 0 and then a host-level ID taken from the lowest
# range that matches the specified name, and using the length of that range.
# Additional ranges are then assigned, using the ranges which specify the
# lowest host-level IDs first, to the lowest not-yet-mapped in-container ID,
# until all of the entries have been used for maps.
#
# remap-user = "storage"
# remap-group = "storage"

[storage.options.overlay]
# ignore_chown_errors can be set to allow a non privileged user running with
# a single UID within a user namespace to run containers. The user can pull
# and use any image even those with multiple uids.  Note multiple UIDs will be
# squashed down to the default uid in the container.  These images will have no
# separation between the users in the container. Only supported for the overlay
# and vfs drivers.
#ignore_chown_errors = false

# Path to an helper program to use for mounting the file system instead of mounting it
# directly.
#mount_program = "/usr/bin/fuse-overlayfs"

# mountopt specifies comma separated list of extra mount options
mountopt = "nodev"

# Size is used to set a maximum size of the container image.
# size = ""

[storage.options.thinpool]
# Storage Options for thinpool

# autoextend_percent determines the amount by which pool needs to be
# grown. This is specified in terms of % of pool size. So a value of 20 means
# that when threshold is hit, pool will be grown by 20% of existing
# pool size.
# autoextend_percent = "20"

# autoextend_threshold determines the pool extension threshold in terms
# of percentage of pool size. For example, if threshold is 60, that means when
# pool is 60% full, threshold has been hit.
# autoextend_threshold = "80"

# basesize specifies the size to use when creating the base device, which
# limits the size of images and containers.
# basesize = "10G"

# blocksize specifies a custom blocksize to use for the thin pool.
# blocksize="64k"

# directlvm_device specifies a custom block storage device to use for the
# thin pool. Required if you setup devicemapper.
# directlvm_device = ""

# directlvm_device_force wipes device even if device already has a filesystem.
# directlvm_device_force = "True"

# fs specifies the filesystem type to use for the base device.
# fs="xfs"

# log_level sets the log level of devicemapper.
# 0: LogLevelSuppress 0 (Default)
# 2: LogLevelFatal
# 3: LogLevelErr
# 4: LogLevelWarn
# 5: LogLevelNotice
# 6: LogLevelInfo
# 7: LogLevelDebug
# log_level = "7"

# min_free_space specifies the min free space percent in a thin pool require for
# new device creation to succeed. Valid values are from 0% - 99%.
# Value 0% disables
# min_free_space = "10%"

# mkfsarg specifies extra mkfs arguments to be used when creating the base.
# device.
# mkfsarg = ""

# Size is used to set a maximum size of the container image.
# size = ""

# use_deferred_removal marks devicemapper block device for deferred removal.
# If the thinpool is in use when the driver attempts to remove it, the driver 
# tells the kernel to remove it as soon as possible. Note this does not free
# up the disk space, use deferred deletion to fully remove the thinpool.
# use_deferred_removal = "True"

# use_deferred_deletion marks thinpool device for deferred deletion.
# If the device is busy when the driver attempts to delete it, the driver
# will attempt to delete device every 30 seconds until successful.
# If the program using the driver exits, the driver will continue attempting
# to cleanup the next time the driver is used. Deferred deletion permanently
# deletes the device and all data stored in device will be lost.
# use_deferred_deletion = "True"

# xfs_nospace_max_retries specifies the maximum number of retries XFS should
# attempt to complete IO when ENOSPC (no space) error is returned by
# underlying storage device.
# xfs_nospace_max_retries = "0"
@TomSweeneyRedHat
Copy link
Member

@vertti thanks for the issue. I've tried on a couple of different machines trying Bulidah directly and can't reproduce. See below. Just out of curiosity can you try changing your Dockerfile to use FROM alpine and see if you get the same? If you've Buildah on board, can you try the steps from my test results below? Also I ran using root, had you tried this rootless?

# cat ~/Dockerfile.buster
FROM node:12-buster
ADD temp.txt .

# buildah bud -t tom -f ~/Dockerfile.buster --layers .
STEP 1: FROM node:12-buster
STEP 2: ADD temp.txt .
--> Using cache 0900caaaad1cb9291c15185c87b3e0fc13e57cf91d49c36aa9129953bda13512
STEP 3: COMMIT tom
--> 0900caaaad1
0900caaaad1cb9291c15185c87b3e0fc13e57cf91d49c36aa9129953bda13512

# buildah inspect --format '{{.Docker.OS}}' tom
linux

@vertti
Copy link
Author

vertti commented Mar 15, 2020

I also get the correct "linux" result with your buildah command. But podman still prints empty string for Os.

$ cat Dockerfile 
FROM node:12-buster

ADD package.json .
$ sudo buildah bud -t tom -f Dockerfile --layers .
STEP 1: FROM node:12-buster
STEP 2: ADD package.json .
--> Using cache c07c461de47b57ef1588a2456c70144ef465b90f19559f5c53e8b798fcf0a195
STEP 3: COMMIT tom
--> c07c461de47
c07c461de47b57ef1588a2456c70144ef465b90f19559f5c53e8b798fcf0a195
$ sudo buildah inspect --format '{{.Docker.OS}}' tom
linux

but continuing with podman you can see the layer hashes match:

$ sudo podman build -t foo .
STEP 1: FROM node:12-buster
STEP 2: ADD package.json .
--> Using cache c07c461de47b57ef1588a2456c70144ef465b90f19559f5c53e8b798fcf0a195
STEP 3: COMMIT foo
--> c07c461de47
c07c461de47b57ef1588a2456c70144ef465b90f19559f5c53e8b798fcf0a195

and the Os is still empty

$ sudo podman inspect foo
[
    {
        "Id": "c07c461de47b57ef1588a2456c70144ef465b90f19559f5c53e8b798fcf0a195",
        "Digest": "sha256:ca290537951662f294276a3346af90de401a271290479d33296f33f1e4d6295f",
        "RepoTags": [
            "localhost/foo:latest",
            "localhost/tom:latest"
        ],
        "RepoDigests": [
            "localhost/foo@sha256:94ac642a8e25e2c949c5407e45e147cb1930af79ba9535734e87d284c488fdf6",
            "localhost/foo@sha256:ca290537951662f294276a3346af90de401a271290479d33296f33f1e4d6295f",
            "localhost/tom@sha256:94ac642a8e25e2c949c5407e45e147cb1930af79ba9535734e87d284c488fdf6",
            "localhost/tom@sha256:ca290537951662f294276a3346af90de401a271290479d33296f33f1e4d6295f"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2020-03-14T07:16:42.726255154Z",
        "Config": {
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_VERSION=12.16.1",
                "YARN_VERSION=1.22.0"
            ],
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "Cmd": [
                "node"
            ]
        },
        "Version": "",
        "Author": "",
        "Architecture": "",
        "Os": "",
        "Size": 909063672,

@rhatdan
Copy link
Member

rhatdan commented Mar 16, 2020

This has been fixed in podman.

@matzew
Copy link

matzew commented Mar 20, 2020

@rhatdan I am running into the same issue.

but I do not yet seem to get 1.8.2 on Fedora?

sudo dnf update podman

gives me:

...
Nothing to do.
Complete!

@rhatdan
Copy link
Member

rhatdan commented Mar 20, 2020

It should be in updates-testing.

dnf -y update podman --enablerepo updates-testing

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants