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 is empty string #5503

Closed
vertti opened this issue Mar 15, 2020 · 4 comments · Fixed by #5508
Closed

Os is empty string #5503

vertti opened this issue Mar 15, 2020 · 4 comments · Fixed by #5508
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@vertti
Copy link

vertti commented Mar 15, 2020

/kind bug

Description

Originally filed it to buildah here containers/buildah#2225 but it seems not to be a buildah issue.

Steps to reproduce the issue:

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",

Additional information you deem important (e.g. issue happens only occasionally):

While discussing on the buildah issue tracker, it seems buildah will get the correct Os field:

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,

Output of podman version:

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

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.12.10
  podman version: 1.8.1
host:
  BuildahVersion: 1.14.2
  CgroupVersion: v1
  Conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.11, commit: '
  Distribution:
    distribution: ubuntu
    version: "19.10"
  IDMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  MemFree: 1194098688
  MemTotal: 16521637888
  OCIRuntime:
    name: runc
    package: 'containerd.io: /usr/bin/runc'
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc10
      commit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
      spec: 1.0.1-dev
  SwapFree: 1546010624
  SwapTotal: 2147479552
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: vertin-x1
  kernel: 5.3.0-40-generic
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: 'slirp4netns: /usr/bin/slirp4netns'
    Version: |-
      slirp4netns version 0.4.3
      commit: unknown
  uptime: 41h 17m 14.3s (Approximately 1.71 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  ConfigFile: /home/vertti/.config/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: 'fuse-overlayfs: /usr/bin/fuse-overlayfs'
      Version: |-
        fusermount3 version: 3.4.1
        fuse-overlayfs: version 0.7.6
        FUSE library version 3.4.1
        using FUSE kernel interface version 7.27
  GraphRoot: /home/vertti/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 3
  RunRoot: /run/user/1000/containers
  VolumePath: /home/vertti/.local/share/containers/storage/volumes

Package info (e.g. output of rpm -q podman or apt list podman):

podman/unknown,now 1.8.1~1 amd64 [installed]
podman/unknown 1.8.1~1 arm64
podman/unknown 1.8.1~1 armhf

Additional environment details (AWS, VirtualBox, physical, etc.):
Running podman with sudo on ubuntu 19.10

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 15, 2020
@baude baude self-assigned this Mar 15, 2020
@baude
Copy link
Member

baude commented Mar 15, 2020

im looking into this ... i have determined that podman build is not setting the field. it is not inspect which was my first concern.

baude added a commit to baude/podman that referenced this issue Mar 15, 2020
when building images, we can now add the os and arch of the image using overrides from the commandline.  the commandline options set sane defaults so we use those as well.

Fixes: containers#5503

Signed-off-by: Brent Baude <[email protected]>
@baude
Copy link
Member

baude commented Mar 15, 2020

@vertti if you can try the PR and report back, that is always helpful.

@vertti
Copy link
Author

vertti commented Mar 16, 2020

Thanks, I will take the fix for a spin! But why isn't everyone using OpenShift stumbled to this issue? What are they using to get their custom containers to run on OpenShift? I must be missing something here..

@danielvaughan
Copy link

This seems to be have introduced with a more aggressive check for os in

https://github.com/containers/image/blob/d66f61bca2276786c2362ee33113dbb8f6012299/copy/copy.go

added on 22nd Nov 2019. The check stopped raising an error on 31st Jan 2020. Perhaps OpenShift is using code from this window?

snj33v pushed a commit to snj33v/libpod that referenced this issue May 31, 2020
when building images, we can now add the os and arch of the image using overrides from the commandline.  the commandline options set sane defaults so we use those as well.

Fixes: containers#5503

Signed-off-by: Brent Baude <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants