Skip to content

Commit 60f2179

Browse files
committed
Add Podman compatibility to vox:build task
Prior to this commit, running the `vox:build` task via the `podman-docker` shim would fail as `podman ls --format json` prints an empty array, `[]`, when no containers match `--filter`. This differs from `docker ls` behavior of printing nothing to STDOUT. This extra output resulted in the `container_exists` function returning a false positive, which caused the task to fail when trying to run `podman stop` on containers that didn't exist. This commit changes the command to use `--format '{{json .ID}}'` as this produces the same behavior from both `podman` and `docker`: no STDOUT when nothing matches, and a quoted string containing the container ID when there is a match. Signed-off-by: Charlie Sharpsteen <charlie@overlookinfratech.com>
1 parent ec8163b commit 60f2179

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rakelib/utils/docker_runner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def image_exists?
1616
end
1717

1818
def container_exists?
19-
!`docker container ls --all --filter 'name=#{container_name}' --format json`.strip.empty?
19+
!`docker container ls --all --filter 'name=#{container_name}' --format '{{json .ID}}'`.strip.empty?
2020
end
2121

2222
def teardown

0 commit comments

Comments
 (0)