Skip to content

Add Podman engine #160

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions engine/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ _portage_image_processed='false'
# Is this engine functional? Called once per engine in current image dependency graph.
function validate_engine() {
local docker_version
_required_binaries+=" docker"
_required_binaries+=" ${DOCKER}"
has_required_binaries
docker_version=$(${DOCKER} "version") || die "Failed to query the docker daemon:\\n${docker_version}"
docker_version=$(${DOCKER} "version") || die "Failed to query ${DOCKER}:\\n${docker_version}"
}

# Has given image_id all requirements to start the build? Called once per image in current image dependency graph.
Expand Down Expand Up @@ -240,15 +240,20 @@ function build_image() {
|| { msg_error "${_status_msg}"; die; }
fi

_status_msg="exec docker build -t ${image_id}:${IMAGE_TAG}"
_status_msg="exec ${DOCKER} build -t ${image_id}:${IMAGE_TAG}"
# shellcheck disable=SC2086
pwrap "${DOCKER}" build ${DOCKER_BUILD_OPTS} -t "${image_id}:${IMAGE_TAG}" "${image_path}" || die "${_status_msg}"

_status_msg="tag image ${image_id}:latest"
pwrap 'nolog' "${DOCKER}" tag "${image_id}:${IMAGE_TAG}" "${image_id}:latest" || die "${_status_msg}"

[[ "${KUBLER_POSTBUILD_IMAGE_PRUNE}" == 'true' ]] \
&& _status_msg="remove untagged images" && pwrap "${DOCKER}" image prune -f
if [[ "${DOCKER}" == 'docker' ]]; then
[[ "${KUBLER_POSTBUILD_IMAGE_PRUNE}" == 'true' ]] \
&& _status_msg="remove untagged images" && pwrap "${DOCKER}" image prune -f
else
[[ "${KUBLER_POSTBUILD_IMAGE_PRUNE}" == 'true' ]] \
&& _status_msg="remove untagged images" && pwrap "${DOCKER}" image prune
fi

[[ "${KUBLER_POSTBUILD_VOLUME_PRUNE}" == 'true' ]] \
&& _status_msg="remove unused volumes" && pwrap "${DOCKER}" volume prune -f
Expand Down
7 changes: 7 additions & 0 deletions engine/podman.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) 2014-2019, Erik Dannenberg <erik.dannenberg@xtrade-gmbh.de>
# All rights reserved.

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

DOCKER="podman"