Skip to content

Support PREK_CONTAINER_RUNTIME=podman to override container runtime#1033

Merged
j178 merged 2 commits intoj178:masterfrom
st1971:feat/first-class-podman
Nov 7, 2025
Merged

Support PREK_CONTAINER_RUNTIME=podman to override container runtime#1033
j178 merged 2 commits intoj178:masterfrom
st1971:feat/first-class-podman

Conversation

@st1971
Copy link
Contributor

@st1971 st1971 commented Nov 3, 2025

use both docker and podman runtimes

  1. if only docker on path use docker runtime
  2. if only podman on path use podman runtime
  3. if both docker and podman on path prefer docker
  4. If PREK_CONTAINER_RUNTIME set use that runtime, currently supports docker and podman

@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 89.52381% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.85%. Comparing base (9c70b50) to head (a8a3a72).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/languages/docker.rs 89.52% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1033      +/-   ##
==========================================
+ Coverage   89.83%   89.85%   +0.01%     
==========================================
  Files          72       72              
  Lines       13138    13272     +134     
==========================================
+ Hits        11802    11925     +123     
- Misses       1336     1347      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

📦 Cargo Bloat Comparison

Binary size change: +0.00% (16.2 MiB → 16.2 MiB)

Expand for cargo-bloat output

Head Branch Results

 File  .text     Size          Crate Name
 0.6%   1.3% 101.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.3%  97.4KiB           prek prek::builtin::pre_commit_hooks::Implemented::run::{{closure}}
 0.6%   1.2%  94.2KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}
 0.4%   1.0%  72.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.6%  48.8KiB           prek prek::run::{{closure}}
 0.2%   0.5%  40.0KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.1KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  37.3KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.4%  32.5KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.4%  32.3KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  31.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.4%  31.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  25.4KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
 0.2%   0.3%  25.1KiB           prek prek::main
 0.1%   0.3%  24.8KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
 0.1%   0.3%  24.8KiB           prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.3%  24.2KiB           prek prek::languages::golang::installer::GoInstaller::install::{{closure}}
 0.1%   0.3%  23.9KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
39.9%  87.6%   6.5MiB                And 10185 smaller methods. Use -n N to show more.
45.6% 100.0%   7.4MiB                .text section size, the file size is 16.2MiB

Base Branch Results

 File  .text     Size          Crate Name
 0.6%   1.3% 101.3KiB          prek? <prek::cli::Command as clap_builder::derive::Subcommand>::augment_subcommands
 0.6%   1.3%  97.4KiB           prek prek::builtin::pre_commit_hooks::Implemented::run::{{closure}}
 0.6%   1.2%  94.2KiB           prek prek::languages::<impl prek::config::Language>::run::{{closure}}
 0.4%   1.0%  72.7KiB           prek prek::archive::unpack::{{closure}}
 0.3%   0.6%  48.8KiB           prek prek::run::{{closure}}
 0.2%   0.5%  40.0KiB           prek prek::languages::<impl prek::config::Language>::install::{{closure}}
 0.2%   0.5%  39.1KiB          prek? <prek::cli::RunArgs as clap_builder::derive::Args>::augment_args
 0.2%   0.5%  37.3KiB regex_automata regex_automata::meta::strategy::new
 0.2%   0.4%  32.5KiB             h2 h2::proto::connection::Connection<T,P,B>::poll
 0.2%   0.4%  32.3KiB           prek prek::languages::node::installer::NodeInstaller::install::{{closure}}
 0.2%   0.4%  31.9KiB             h2 h2::proto::connection::DynConnection<B>::recv_frame
 0.2%   0.4%  31.5KiB           prek prek::workspace::Workspace::discover
 0.2%   0.4%  30.8KiB           prek prek::cli::run::run::run::{{closure}}
 0.2%   0.4%  27.6KiB           prek prek::identify::by_extension::{{closure}}
 0.2%   0.3%  25.4KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::connect_to::{{closure}}::{{closure}}::{{closure}}
 0.2%   0.3%  25.1KiB           prek prek::main
 0.1%   0.3%  24.8KiB     hyper_util hyper_util::client::legacy::client::Client<C,B>::send_request::{{closure}}
 0.1%   0.3%  24.8KiB           prek prek::hook::HookBuilder::build::{{closure}}
 0.1%   0.3%  24.2KiB           prek prek::languages::golang::installer::GoInstaller::install::{{closure}}
 0.1%   0.3%  23.9KiB          hyper hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop
39.9%  87.6%   6.5MiB                And 10181 smaller methods. Use -n N to show more.
45.6% 100.0%   7.4MiB                .text section size, the file size is 16.2MiB

@j178 j178 added the enhancement New feature or request label Nov 4, 2025

- `PREK_NATIVE_TLS` - Use system's trusted store instead of the bundled `webpki-roots` crate.

- `PREK_FORCE_PODMAN` - If both docker and podman exist force the use of podman over docker.
Copy link
Owner

@j178 j178 Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m thinking we could call this PREK_CONTAINER_RUNTIME. By default, prek would automatically try whatever’s available—docker, podman, etc. But you could override that with PREK_CONTAINER_RUNTIME if you want to force a specific one. Like, set it to docker to only use docker, or podman to only use podman. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me, happy to make that change later today 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have updated as suggested, hope it looks ok :-)

@st1971 st1971 force-pushed the feat/first-class-podman branch from f76bf44 to 1073ff2 Compare November 4, 2025 18:51
use both docker and podman runtimes

1. if only docker on path use docker runtime
2. if only podman on path use podman runtime
3. to specify runtime use PREK_CONTAINER_RUNTIME

Signed-off-by: Steven Taylor <steven@taylormuff.co.uk>
@st1971 st1971 force-pushed the feat/first-class-podman branch from 1073ff2 to 6fa02b9 Compare November 4, 2025 18:53
@j178 j178 changed the title container runtime selection Support PREK_CONTAINER_RUNTIME=podman to override container runtime Nov 7, 2025
@j178 j178 merged commit b957e17 into j178:master Nov 7, 2025
21 checks passed
@j178
Copy link
Owner

j178 commented Nov 7, 2025

Thank you!

@st1971
Copy link
Contributor Author

st1971 commented Nov 8, 2025

No problem, should be thanking you for the goodness knows how many hours you have spent on this :-)

@st1971 st1971 deleted the feat/first-class-podman branch November 8, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants