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

Support for Podman as Docker alternative #1552

Open
drenizg opened this issue Aug 25, 2023 · 0 comments
Open

Support for Podman as Docker alternative #1552

drenizg opened this issue Aug 25, 2023 · 0 comments

Comments

@drenizg
Copy link

drenizg commented Aug 25, 2023

Expected behaviour

To be able to use Podman as a valid alternative to Docker, with no warnings

Actual behaviour

Currently, it is possible to successfully use Podman to build container images via setting this in build.sbt:

dockerExecCommand := List("podman")

However, you'll get the following warning:

[warn] [1] sbt-native-packager wasn't able to identify the docker version. Some features may not be enabled
[warn] sbt-native packager tries to parse the `docker version` output. This can fail if
[warn] 
[warn]   - the output has changed:
[warn]     $ docker version --format '{{.Server.APIVersion}}'
[warn] 
[warn]   - no `docker` executable is available
[warn]     $ which docker
[warn] 
[warn]   - you have not the required privileges to run `docker`
[warn] 
[warn] You can display the parsed docker version in the sbt console with:
[warn] 
[warn]   sbt:your-project> show dockerApiVersion
[warn] 
[warn] As a last resort you could hard code the docker version, but it's not recommended!!
[warn] 
[warn]   import com.typesafe.sbt.packager.docker.DockerApiVersion
[warn]   dockerApiVersion := Some(DockerApiVersion(1, 40))
[warn]           

As far as I could get, this is due the fact that the regex used to validate Docker Api version expects versions strings like major.minor, but Podman uses major.minor.patch version style. A possible fix would be to change the regex to acknowledge the difference, but that would render Docker version validations useless for Podman (e.g. to check for multistage or chown-flag capabilities).

So, I was wondering if the community would be interested in having a better support for Podman, that at least:

  • Makes it easy and idiomatic to configure Podman for building (changing dockerExecCommand variable seems a bit hackish)
  • Correctly validates Podman version and its related multistage / chown-flag capabilities (not sure if these validations are needed for Podman).

Information

  • What sbt-native-packager are you using: 1.9.16
  • What sbt version: 1.9.2
  • What is your build system: MacOS Ventura 13.2.1
  • What package are you building: Docker
  • What version has your build tool: using Podman 4.6.1
  • What is your target system (e.g. Ubuntu 16.04, CentOS 7): using a JRE 11 alpine image as base
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

1 participant