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

Fix legacy build with podman when there is output on stderr #403

Merged

Conversation

LewisGaul
Copy link
Collaborator

@LewisGaul LewisGaul commented Jan 23, 2023

Fixes #401

When using 'ctr-mgr build --quiet':

  • Docker only outputs image ID (good)
  • Podman v3.4.2 outputs stderr from 'RUN' commands to stderr (hmm)
  • Podman-remote outputs the stderr from podman to stdout (bad)

Solution for all these cases is to take the last line of the output.

Tested manually with podman-remote.

root@ubuntu:~/ctrbuild# cat Dockerfile
FROM alpine
RUN sh -c 'echo "hello" >&2'
root@ubuntu:~/ctrbuild# podman build . -q --no-cache
hello
93eb2c508f2ce21bd39bc86cfea804119a5302994cc8bd94168c46aa9d00ca3b
root@ubuntu:~/ctrbuild# docker build . -q --no-cache
sha256:4c79a365502b79abb668f06ae4ddde5bdfd893d7673c9b10f1987aee970130a0

@LewisGaul LewisGaul marked this pull request as ready for review January 23, 2023 19:15
@gabrieldemarmiesse gabrieldemarmiesse merged commit c2831b1 into gabrieldemarmiesse:master Jan 26, 2023
rafrafek pushed a commit to rafrafek/python-on-whales that referenced this pull request Jan 26, 2023
@LewisGaul LewisGaul deleted the legacy-build-podman branch January 15, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing to get container ID from legacy build output with podman
2 participants