Skip to content

A hook or global (default) options #27370

@hoshsadiq

Description

@hoshsadiq

Feature request description

I am looking to always add some options to all containers. For my use case, this for local development rather than anything else.

I'd like to be able to specify certain volumes to always be attached to containers. Ideally based on certain criteria. Specifically what I'm trying to achieve is to mount some caching directories so that some things don't have to continually re-download, e.g. apt, apk, etc.

I tend to use containers for lots of testing, e.g. spin up a temporary container (podman run...), install some tools (apk add ...), and then exit the container, only to then do it again not long after.

I'd like to be able to always add a volume to all these containers based on certain criteria such as the container image, tag, etc. This way I can add a cache volume for debian:stable, or alpine: etc.

This is also helpful to be able to do at docker level, as e.g. it would allow for cached packages to so that these things can be done offline if for some reason you don't have internet temporarily.

Suggest potential solution

Maybe some additional config that specifies podman run args that would be inject for all containers. Or a hook system that allows me make changes to the podman run command.

Have you considered any alternatives?

I've considered using a wrapper command that adds the arguments I need, but this doesn't capture things like docker compose.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions