Skip to content

Commit 927989f

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 04116c0 commit 927989f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/build.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def image_exists
5454
end
5555

5656
def container_exists
57-
!`docker container ls --all --filter 'name=#{@container}' --format json`.strip.empty?
57+
!`docker container ls --all --filter 'name=#{@container}' --format '{{json .ID}}'`.strip.empty?
5858
end
5959

6060
def teardown

0 commit comments

Comments
 (0)