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 build fails with given buildx platforms #1832

Open
jdelker opened this issue Oct 17, 2024 · 3 comments
Open

podman build fails with given buildx platforms #1832

jdelker opened this issue Oct 17, 2024 · 3 comments

Comments

@jdelker
Copy link

jdelker commented Oct 17, 2024

Description

I'm using docker-maven-plugin with podman, which was working fine so far.
After I added the configuration for a specific build platform (linux/amd64), the builds fails with

[INFO] DOCKER> [my/project:latest]: Created docker-build.tar in 1 second 
[WARNING] DOCKER> Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
[WARNING] DOCKER> time="2024-10-16T18:53:27+02:00" level=warning msg="The --config flag is ignored by Podman. Exists for Docker compatibility"
[WARNING] DOCKER> Error: unrecognized command `podman buildx ls`
[WARNING] DOCKER> Try 'podman buildx --help' for more information
[INFO] DOCKER> docker --config /var/lib/jenkins/workspace/dummy_develop/blafasel/target/drum-dev/.docker.build/my/project/latest/docker buildx create --driver docker-container --name maven
[INFO] DOCKER> Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
[INFO] DOCKER> Error: unknown flag: --driver
[INFO] DOCKER> See 'podman buildx --help'
[ERROR] DOCKER> Error status (125) while creating builder maven

The section added to the docker-maven-plugin config (in "configuration.images.image.build") was:

                <buildx>
                  <platforms>
                    <platform>${docker.platforms}</platform>
                  </platforms>
                </buildx>

With docker.platforms = linux/amd64.

NOTE: linux/amd64 is the native platform architecture. An alternate profile shall also perform builds for linux/arm64.

Info

  • docker-maven-plugin version : 0.45.0
  • Maven version (mvn -v) :
Maven home: /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven-3.9
Java version: 17.0.12, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.12.0.7-2.el8.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-553.22.1.el8_10.x86_64", arch: "amd64", family: "unix"
  • Docker Podman version : 4.9.4-rhel
  • If it's a bug, how to reproduce :
    It should probably sufficient to add the above buildx config to trigger the error.
@rohanKanojia
Copy link
Member

This looks a bit strange. We use docker CLI for doing buildx based builds. Do you know if podman has complete support for buildx? Or maybe command name is different in case of podman?

[WARNING] DOCKER> Error: unrecognized command `podman buildx ls`

@jdelker
Copy link
Author

jdelker commented Oct 17, 2024

From my understanding it should have, but it may use other cli-params:

$> podman buildx --help
Build images

Description:
  Build images

Usage:
  podman buildx [command]

Aliases:
  buildx, builder

Available Commands:
  build       Build an image using instructions from Containerfiles
  prune       Remove unused images
  version     Print build version

@jdelker
Copy link
Author

jdelker commented Oct 17, 2024

Maybe this Redhat Developer Blog Post helps a bit, describing the multi-architecture-build for Docker and Podman.

Do we even require buildx for multi-architecture build?

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

No branches or pull requests

2 participants