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

Failing image build not reported to Docker client through podman API service #12392

Closed
stac47 opened this issue Nov 23, 2021 · 4 comments · Fixed by #12405
Closed

Failing image build not reported to Docker client through podman API service #12392

stac47 opened this issue Nov 23, 2021 · 4 comments · Fixed by #12405
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

@stac47
Copy link

stac47 commented Nov 23, 2021

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

/kind bug

Description

Building an image from an invalid Docker file using docker client through podman API service, should return an error code.

Steps to reproduce the issue:

  1. Start the podman.socket API service
% podman system service -t0 &
  1. Try to build an image from a broken Dockerfile using the podman listening socket:
% DOCKER_HOST="unix:///run/user/$UID/podman/podman.sock" docker build - <<EOF
FROM fedora
RUN false
EOF
  1. No error is reported and the return code should be something else than 0:
% echo "$?"
0

Describe the results you received:

No error is reported and it looks like the build was ok (rc=0).

Describe the results you expected:

Comparing with Docker:

% docker build - <<EOF
FROM fedora
RUN false
EOF
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM fedora
 ---> b080de8a4da3
Step 2/2 : RUN false
 ---> Running in b40682f4568a
The command '/bin/sh -c false' returned a non-zero code: 1
zsh: exit 1     docker build - <<<'FROM fedora RUN false'

Comparing with Podman:

% podman build - <<EOF
FROM fedora
RUN false
EOF
STEP 1/2: FROM fedora
STEP 2/2: RUN false
Error: error building at STEP "RUN false": error while running runtime: exit status 1
zsh: exit 125   podman build - <<<'FROM fedora RUN false'

(Different return code but reports an error occured)

Comparing with podman remote

% podman --remote build - <<EOF
FROM fedora
RUN false
EOF
STEP 1/2: FROM fedora
STEP 2/2: RUN false
Error: error building at STEP "RUN false": error while running runtime: exit status 1

zsh: exit 125   podman --remote build - <<<'FROM fedora RUN false'

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

Output of podman version:

Built this morning with latest commit

Version:      4.0.0-dev
API Version:  4.0.0-dev
Go Version:   go1.17.3
Git Commit:   1bfbb28b0365790552483b961b4bd48a69dd8070
Built:        Tue Nov 23 09:39:21 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:                                                                                                                                                                                                                                                                 [39/5774]
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  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-21-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 865406976
  memTotal: 16779907072
  networkBackend: cni
  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: 185h 24m 26.83s (Approximately 7.71 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: 7
    paused: 0
    running: 0
    stopped: 7
  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: 202
  runRoot: /mnt/my-xfs/podman-user-root
  volumePath: /mnt/my-xfs/podman-user-root/volumes
version:
  APIVersion: 4.0.0-dev
  Built: 1637660361
  BuiltTime: Tue Nov 23 09:39:21 2021
  GitCommit: 1bfbb28b0365790552483b961b4bd48a69dd8070
  GoVersion: go1.17.3
  OsArch: linux/amd64
  Version: 4.0.0-dev

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

N/A built from source

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 Nov 23, 2021
@rhatdan
Copy link
Member

rhatdan commented Nov 23, 2021

This looks like Docker is expecting a different error code then we are sending. Probably something in the API.

@rhatdan
Copy link
Member

rhatdan commented Nov 23, 2021

@flouthoc PTAL

@flouthoc
Copy link
Collaborator

@stac47 above PR should close this.

@stac47
Copy link
Author

stac47 commented Nov 30, 2021

Sorry for the delay. I just tested the PR and it works as expected. Thanks very much.

@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
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