kubler icon indicating copy to clipboard operation
kubler copied to clipboard

Podman engine support

Open babykart opened this issue 6 years ago • 2 comments

Hi,

podman (https://github.com/containers/libpod) support all docker commands, Dockerfiles, and it can be run as user. You can find in attachment podman.sh that is a copy of the engine/docker.sh with minor modifications. The bob-*, builder and image templates does not need modifications. Install podman on gentoo:

emerge -av libpod
cd ${_kubler_install_dir}
ln -sr template/docker template/podman
ln -sr engine/docker engine/podman
wget https://github.com/edannenberg/kubler/files/3161965/podman.txt -O engine/podman.sh

podman.txt

Let me know if you prefer a PR...

PS - @edannenberg thank you for this awesome project.

babykart avatar May 09 '19 12:05 babykart

Hey,

thank you for this! A PR would indeed be prefered but no worries if you are busy.

Had a quick look at the changes, as Podman seems to be a true in-place replacement for Docker we should try to reduce code duplication as much as possible. You can kinda "extend" docker.sh like so:

#!/usr/bin/env bash

source "${_KUBLER_DIR}"/engine/docker.sh

# override functions/vars as required..
DOCKER="podman"

As most changes are related to var names and output it might be better to change docker.sh so it can be extended without having to duplicate a lot of code. Let me know if you need help with that, you can also hit me up on Discord.

edannenberg avatar May 10 '19 12:05 edannenberg

Clearly a better approach than mine. With your approach, the only modification needed in engine/docker.sh is to avoid '-f' argument for 'podman image prune' in build_image():

    [[ "${KUBLER_POSTBUILD_IMAGE_PRUNE}" == 'true' ]] \
        && _status_msg="remove untagged images" && pwrap "${DOCKER}" image prune -f

I will working on it this week end and after some tests, I will do a PR.

babykart avatar May 10 '19 16:05 babykart