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

Do not error out when there are no Docker containers or images #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

woopla
Copy link

@woopla woopla commented May 24, 2024

I'm trying to deploy KFD on a set of new VMs, and our default Rocky 8 image is configured with Docker. The Ansible playbook will fail with:

    "docker rm" requires at least 1 argument.
    See 'docker rm --help'.
  
    Usage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]
  
    Remove one or more containers

That's because the output of docker ps -a -q is empty. I've fixed all three calls to go through xargs -r so it's not even trying when there is nothing to delete.

Prior to this change, a fresh VM with Docker pre-installed could not be set up, because an empty output was passed to the deletion commands.
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

Successfully merging this pull request may close these issues.

None yet

1 participant