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

Podman/Docker API mismatch: cannot get the image ID #12063

Closed
stac47 opened this issue Oct 22, 2021 · 2 comments · Fixed by #12091
Closed

Podman/Docker API mismatch: cannot get the image ID #12063

stac47 opened this issue Oct 22, 2021 · 2 comments · Fixed by #12091
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. 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

@stac47
Copy link

stac47 commented Oct 22, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Using the Docker SDK to target podman server, the reply from podman to an image build does not match the one from docker daemon.

Steps to reproduce the issue:

  1. Start a podman daemon:
% podman  system service -t 0 &
  1. Use the docker client to build an image targeting the podman daemon:
% DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock docker build -t test .

Describe the results you received:
If I compare the HTTP reply, here in podman:

 {"stream":"[1/2] STEP 1/1: FROM fedora AS puz_buildstage_1\n"}
{"stream":"Getting image source signatures\n"}
{"stream":"Copying blob sha256:7500ce202ad6f8c51907f935f1e996b99646d1034a513cb6f1a3a9608a361c9a\n"}
{"stream":"Copying config sha256:8675c677d6f881b676d57cfaec66f8b7416111db42f176ea075fe79183b546f1\n"}
{"stream":"Writing manifest to image destination\n"}
{"stream":"Storing signatures\n"}
{"stream":"--\u003e 8675c677d6f\n"}
{"stream":"[2/2] STEP 1/2: FROM 8675c677d6f881b676d57cfaec66f8b7416111db42f176ea075fe79183b546f1 AS puz_buildstage_2\n"}
{"stream":"[2/2] STEP 2/2: CMD echo hello\n"}
{"stream":"[2/2] COMMIT basic_fragment\n"}
{"stream":"Getting image source signatures\n"}
{"stream":"Copying blob sha256:7500ce202ad6f8c51907f935f1e996b99646d1034a513cb6f1a3a9608a361c9a\n"}
{"stream":"Copying blob sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef\n"}
{"stream":"Copying config sha256:6025d746f2eea6cf0e71f6e23170ea804f96a0dcffd93646657a0a4f709b1851\n"}
{"stream":"Writing manifest to image destination\n"}
{"stream":"Storing signatures\n"}
{"stream":"--\u003e 6025d746f2e\n"}
{"stream":"Successfully tagged localhost/basic_fragment:latest\n"}
{"stream":"6025d746f2eea6cf0e71f6e23170ea804f96a0dcffd93646657a0a4f709b1851\n"}
{"stream":"Successfully built 6025d746f2ee\n"}
{"stream":"Successfully tagged basic_fragment\n"}

Here is the output by docker:

{"stream":"Step 1/6 : ARG puz_root_image=fedora"}
{"stream":"\n"}
{"stream":"Step 2/6 : FROM ${puz_root_image} AS puz_buildstage_1"}
{"stream":"\n"}
{"stream":" ---\u003e 0e58495b280f\n"}
{"aux":{"ID":"sha256:0e58495b280f3ace00dd8da68d5553753237b081f3ca4d894459c4924b279416"}}
{"stream":"Step 3/6 : FROM puz_buildstage_1 AS puz_buildstage_2"}
{"stream":"\n"}
{"stream":" ---\u003e 0e58495b280f\n"}
{"stream":"Step 4/6 : CMD echo hello"}
{"stream":"\n"}
{"stream":" ---\u003e Using cache\n"}
{"stream":" ---\u003e 5d495af737a9\n"}
{"stream":"Step 5/6 : LABEL puz.help=Generated by Puz"}
{"stream":"\n"}
{"stream":" ---\u003e Using cache\n"}
{"stream":" ---\u003e fa17cca75164\n"}
{"stream":"Step 6/6 : LABEL puz.version=0.6.0"}
{"stream":"\n"}
{"stream":" ---\u003e Using cache\n"}
{"stream":" ---\u006e 32d53a2c2311\n"}
{"aux":{"ID":"sha256:32d53a2c231189519e947ef753e79fce216adf472767605f36386609b3e93e40"}}
{"stream":"Successfully built 32d53a2c2311\n"}
 "stream":"Successfully tagged basic_fragment:latest\n"}

Describe the results you expected:

In the docker reply, the image ID I just built is in:

{"aux":{"ID":"sha256:32d53a2c231189519e947ef753e79fce216adf472767605f36386609b3e93e40"}}

While in podman:

{"stream":"6025d746f2eea6cf0e71f6e23170ea804f96a0dcffd93646657a0a4f709b1851\n"}

This can be a problem when using the docker SDK to retrieve the image ID.
Moreover, the ID provided by podman is not prefixed by "sha256:".

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

Output of podman version:

Freshly built

% ./bin/podman version
Version:      4.0.0-dev
API Version:  4.0.0-dev
Go Version:   go1.17
Git Commit:   9e453e242e39da44badbbef985fa03b16dfd87e9
Built:        Fri Oct 22 09:04:23 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/bin/conmon'
    path: /usr/bin/conmon
    version: 'conmon version 2.0.25, commit: unknown'
  cpus: 8
  distribution:
    codename: impish
    distribution: ubuntu
    version: "21.10"
  eventLogger: journald
  hostname: lstacul-vm
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
  kernel: 5.13.0-16-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 9339215872
  memTotal: 16779874304
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.17
      commit: 0e9229ae34caaebcb86f1fde18de3acaf18c6d9a
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.4.0
  swapFree: 0
  swapTotal: 0
  uptime: 637h 3m 4.01s (Approximately 26.54 days)
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/ubuntu/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /mnt/my-xfs/podman-user-root
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 6
  runRoot: /mnt/my-xfs/podman-user-root
  volumePath: /mnt/my-xfs/podman-user-root/volumes
version:
  APIVersion: 4.0.0-dev
  Built: 1634893463
  BuiltTime: Fri Oct 22 09:04:23 2021
  GitCommit: 9e453e242e39da44badbbef985fa03b16dfd87e9
  GoVersion: go1.17
  OsArch: linux/amd64
  Version: 4.0.0-dev

Package info (e.g. output of rpm -q podman or apt list podman):
Also occurs with the system podman

podman/impish,now 3.2.1+ds1-2ubuntu3 amd64 [installed]

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 22, 2021
@mheon mheon added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Oct 25, 2021
ananthb added a commit to ananthb/podman that referenced this issue Oct 25, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
ananthb added a commit to ananthb/podman that referenced this issue Nov 22, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Nov 29, 2021

There is a pull request to fix this.

ananthb added a commit to ananthb/podman that referenced this issue Dec 1, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
ananthb added a commit to ananthb/podman that referenced this issue Dec 4, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
ananthb added a commit to ananthb/podman that referenced this issue Dec 11, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
ananthb added a commit to ananthb/podman that referenced this issue Dec 11, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
ananthb added a commit to ananthb/podman that referenced this issue Dec 14, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
ananthb added a commit to ananthb/podman that referenced this issue Dec 14, 2021
Signed-off-by: Ananth Bhaskararaman <antsub@gmail.com>
openshift-merge-robot added a commit that referenced this issue Dec 14, 2021
Fixes #12063 Add docker compatible output after image build.
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. 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.

3 participants