#With Dagger 0.18.10, I'm using `finch`
1 messages · Page 1 of 1 (latest)
what's finch?
from the output it seems like it left the original container there, which is why it "worked" - blind guess though
maybe its docker ps command works differently - it didn't find anything, but then there was a name conflict anyway
It was created by the folks at AWS
I can look for how we do docker ps exactly. If it's down to looking at CLI output, I could imagine a slight human-readable difference could matter to our script
yeah that's what I'm thinkin. you can see the command we run in Cloud: https://dagger.cloud/dagger/traces/42db4f3bad4ab10235d1165ab1055316?span=26a296f673c6fe43
docker ps -a --no-trunc --filter "name=^dagger-engine-|^dagger-engine-v0\\.18\\.10$" --format "{{.Names}}"
Yep different @hallow willow
With docker -> finch, no output from our docker ps
Use "finch [command] --help" for more information about a command.
~ ➤ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e49c0354bb8b registry.dagger.io/engine:v0.18.9 "dagger-entrypoint.s…" 3 hours ago Up dagger-engine-v0.18.9
c604f3fe2884 registry.dagger.io/engine:v0.18.10 "dagger-entrypoint.s…" 3 hours ago Up dagger-engine-v0.18.10
~ ➤ docker ps -a --no-trunc --filter "name=^dagger-engine-|^dagger-engine-v0\\.18\\.10$" --format "{{.Names}}"
With actual docker
~ ➤ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8d46f7dd88ac registry.dagger.io/engine:v0.18.10 "dagger-entrypoint.s…" 22 seconds ago Up 21 seconds dagger-engine-v0.18.10
~ ➤ docker ps -a --no-trunc --filter "name=^dagger-engine-|^dagger-engine-v0\\.18\\.10$" --format "{{.Names}}"
dagger-engine-v0.18.10 ⬅️
ah maybe they don't support --format
--format is okay
docker ps -a --no-trunc --format "{{.Names}}"
dagger-engine-v0.18.9
dagger-engine-v0.18.10
--filter not working...
~ ➤ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e49c0354bb8b registry.dagger.io/engine:v0.18.9 "dagger-entrypoint.s…" 3 hours ago Up dagger-engine-v0.18.9
c604f3fe2884 registry.dagger.io/engine:v0.18.10 "dagger-entrypoint.s…" 3 hours ago Up dagger-engine-v0.18.10
~ ➤ docker ps -a --no-trunc --filter "name=^dagger-engine-|^dagger-engine-v0\\.18\\.10$"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
~ ➤
-f, --filter strings Filter matches containers based on given conditions. When specifying the condition 'status', it filters all containers
It's choking on the regex
works without it
~ ➤ docker ps -a --no-trunc --filter "name=dagger-engine-" --format "{{.Names}}"
dagger-engine-v0.18.9
dagger-engine-v0.18.10
@hallow willow I wonder if we could get away with the simpler filter 👆
works with actual docker too
~ ➤ docker ps -a --no-trunc --filter "name=dagger-engine-" --format "{{.Names}}"
dagger-engine-v0.18.10
yeah probably, it looks like it's already including that so not sure why we'd also want the more specific match
this works too (*), used many places
docker ps -a --no-trunc --filter "name=dagger-engine-*" --format "{{.Names}}"
dagger-engine-v0.18.10
👆 I think I'll need @young agate to look at since the more complex regex filter that seems to be choking in some places was added here.
finch uses nerdctl
the logic for the filtering in nerdctl is here: https://github.com/containerd/nerdctl/blob/65f4412ea5058de79856d59d21fbe94b042f6f16/pkg/cmd/container/list_util.go#L166-L174 (no regex support in sight)
i'll be honest, i don't really understand how * works there (i can't get that to work actually)
root@e4af6a6d57fa:/# nerdctl ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d21c34b4b65a docker.io/library/alpine:latest "sleep 1000000" About a minute ago Up foo-bar
root@e4af6a6d57fa:/# nerdctl ps --filter name="foo-"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d21c34b4b65a docker.io/library/alpine:latest "sleep 1000000" About a minute ago Up foo-bar
root@e4af6a6d57fa:/# nerdctl ps --filter name="foo-*"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
don't think we can easily do this unless we rework the logic to do all of the filtering in go.
we need to collect all of the additionalNames as well as the containerNamePrefix
this is what allows the same logic to work with an arbitrary docker-image:// set in the env
here's how it's implemented in docker: https://github.com/moby/moby/blob/6d737371b8100f93c705e87fdb626d2003103506/daemon/list.go#L446-L449
the Match function supports regexp
opened an issue upstream: https://github.com/containerd/nerdctl/issues/4323