docker-maven-plugin: Podman not supported

Description

Info

  • d-m-p version : 0.28.0
  • Maven version (mvn -v) :
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)
Maven home: /home/kb1000/.m2/wrapper/dists/apache-maven-3.6.2-bin/795eh28tki48bv3l67maojf0ra/apache-maven-3.6.2
Java version: 1.8.0_242, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.fc31.x86_64/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "5.5.6-201.fc31.x86_64", arch: "amd64", family: "unix"
  • Docker version : none, emulated using podman 1.8.0 from Fedora 31
  • If it’s a bug, how to reproduce : Install podman on Fedora 31 using sudo dnf install podman-docker and try to use this Maven plugin
  • If it’s a feature request, what is your use case :
  • Sample project : https://github.com/quarkusio/quarkus-quickstarts (tested with hibernate-search-elasticsearch-quickstart project there)
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.28.0:stop (docker-start) on project hibernate-search-elasticsearch-quickstart: Execution docker-start of goal io.fabric8:docker-maven-plugin:0.28.0:stop failed: No <dockerHost> given, no DOCKER_HOST environment variable, no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and no external provider like Docker machine configured -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[kb1000@local-host hibernate-search-elasticsearch-quickstart]$ docker
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: missing command 'podman COMMAND'
Try 'podman --help' for more information.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 9
  • Comments: 27 (2 by maintainers)

Most upvoted comments

Updating here since people seem to have bookmarked this place:

Podman evolved a bit, the better command is now:

podman system service --time=0 unix:/run/user/$(id -u)/podman/podman.sock

Podman 2.0 which is in release candidate stage now supports the REST API of the docker daemon.

Many thanks for this, it’s extremely useful!

Updating instructions though, N.B. both preparations commands have to be adjusted slightly now:

 export DOCKER_HOST="unix:/run/user/$(id -u)/podman/podman.sock"
 podman system service -t 3600 &
 mvn ...

(At least, that’s what I need to do on Fedora 33 - running as non-root as well. I have both podman and podman-docker installed)

Additionally, some widely used images attempt to perform operations which are typically not allowed under the more restrictive (good) defaults for podman; in many cases it’s enough to update the containers, as many have fixed their images.

for example, postgres:10.5 won’t work, but postgres:13.1 works flawlessly.

FWIW the plugin now seems to work (at least partially) with podman >=2.0.

To make it work as a non-root user do:

podman service -t 3600 & # This will start podman's REST API and keep it alive for 1 hour (3600 seconds)
export DOCKER_HOST="export DOCKER_HOST="unix:/run/user/$(id -u)/podman/podman.sock"
mvn ...

Hi, up to now it worked well for me to use the plugin with Podman using podman system service. However, I encountered the following problem today when using docker:push latest (formatted the output for better readability):

DOCKER> Unable to inspect image [sha256:e9685] : 
{
  "cause": "normalizing name for compat API: sha256:e9685: invalid format: no 64-byte hexadecimal value",
  "message": "normalizing image: normalizing name for compat API: sha256:e9685: invalid format: no 64-byte hexadecimal value",
  "response": 500
}

(Internal Server Error: 500)]

The reason seems to be that the plugin uses 5-byte hex shortcuts while the podman-docker-service requires the full 64-byte hex value.

I am using podman in version 4.3.1 together with the latest plugin version 0.40.3.

As an idea, we could add support for starting (and stopping) the Podman service transparently, similar like the support we have for docker-machine (see the docs).

Please open an issue against podman.

I see, thanks for the investigation. Let’s tackle Podman support for the next release. At least those two issues should be easy to fix.