This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-05
Channels
- # announcements (5)
- # babashka (2)
- # beginners (47)
- # calva (3)
- # cider (42)
- # clerk (5)
- # clj-commons (21)
- # clojure (145)
- # clojure-austin (25)
- # clojure-europe (14)
- # clojure-norway (9)
- # clojure-spec (7)
- # clojurescript (21)
- # datomic (4)
- # dev-tooling (4)
- # docker (5)
- # gratitude (5)
- # honeysql (6)
- # hyperfiddle (45)
- # jobs (1)
- # juxt (2)
- # malli (25)
- # meander (1)
- # mount (3)
- # other-languages (7)
- # pathom (7)
- # pedestal (1)
- # reagent (5)
- # reitit (20)
- # releases (2)
- # remote-jobs (1)
- # shadow-cljs (77)
- # squint (8)
- # tools-deps (34)
Hi! I'm trying to figure out how to provide filters when listing containers and images with https://github.com/lispyclouds/contajners. (docs: https://docs.docker.com/engine/api/v1.41/#tag/Container/operation/ContainerList).
Example: Get first 3 containers with status exited
(let [client (c/client {:engine :docker
:version "v1.41"
:conn {:uri "unix:///var/run/docker.sock"}
:category :containers})]
(c/invoke client {:op :ContainerList
:params {:limit 3
:filters {:status ["exited"]}}}))
Here I get this error
{:message "invalid character ':' looking for beginning of object key string"}
The :limit
query param works as expected, but I can't figure out what to give to :filters
. I've tried the following formats
{:filters {:status ["exited"]}}
{:filters {:status "exited"}}
{:filters {"status""exited"}}
{:filters {'status "exited"}}
{:filters ["status=exited]"]} ;; the docker cli syntax
With no luck. Anyone has a working example of how to provide filters? Thanks in advance 🙂Diese Nachricht enthält interaktive Elemente.
I think I tried that very manually yesterday, but I'll give it a try when I'm home and report back :)
1
tried now with
(invoke client
{:op :ContainerList
:params {:limit 3
:filters "{\"status\": [\"exited\"]}"}})
seems to worki ran on Podman now, but should work fine on Docker too