Open TylorF opened 6 years ago
This seems to be fixed in version 18.03 for querying by name, but it still seems to fail to query by container id.
since & before option does not seem to be working with 18.06.6 CE version as well.... though it is working fine with container name... Do I need to upgrade to newer version or this is not at all supported in CE version
Use the full ID as a workaround.
I'll send a pull request to fix this issue.
@wenjianhn it doesn't work even with the full ID:
root@ubuntu:/home/ubuntu/gottybin# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
911dae555915 ubuntu "/bin/bash -c ' echo…" 11 minutes ago Up 11 minutes quirky_ritchie
65029dd075c3 ubuntu "/bin/bash -c ' echo…" 11 minutes ago Up 11 minutes quirky_dirac
bbf89aab8580 ubuntu "/bin/bash -c ' echo…" 11 minutes ago Up 11 minutes nervous_swirles
3fa0a7acdefd ubuntu "/bin/bash -c ' echo…" 11 minutes ago Up 11 minutes pensive_margulis
21dec558f37e ubuntu "/bin/bash -c ' echo…" 11 minutes ago Up 11 minutes blissful_elbakyan
8dd54badf401 ubuntu "/bin/bash -c ' echo…" 11 minutes ago Up 11 minutes eloquent_dubinsky
root@ubuntu:/home/ubuntu# docker ps --filter "since=bbf89aab8580"
Error response from daemon: no such container bbf89aab8580
I tried to see all the container since "bbf89aab8580" (full ID) and it still failed.
Docker version:
root@ubuntu:/home/ubuntu/gottybin# docker version
Client: Docker Engine - Community
Version: 20.10.7
API version: 1.41
Go version: go1.13.15
Git commit: f0df350
Built: Wed Jun 2 11:56:38 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:54:50 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0-rc95
GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
docker-init:
Version: 0.19.0
GitCommit: de40ad0
I'm not able to reproduce the problem when using the container name;
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
35efc3511f30 busybox "sh -c 'touch /fooba…" 45 minutes ago Created elastic_leavitt
8e5cb7596fcd busybox "sh" 6 weeks ago Created bla
7a9c4f4cd3fd thajeztah/f3tsh:latest "/f3tsh" 7 weeks ago Exited (2) 2 days ago f3tsh.1.udmq009i4j38nkk0n5obuf9zo
docker ps --filter before=bla
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
docker ps --filter since=bla
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8db9ffcef1f0 thajeztah/f3tsh:latest "/f3tsh" 2 days ago Up 2 days 80/tcp, 443/tcp f3tsh.1.9rb332ygu7t31zbrp0a431q64
For the id
case, that looks indeed that currently only full (non-truncated) ID's are supported;
docker ps --filter since=8e5cb7596fcd
Error response from daemon: no such container 8e5cb7596fcd
docker ps --no-trunc -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
35efc3511f30580355590843ba5e98fe6c78bb9a23a3b26dbc675645960f5dab busybox "sh -c 'touch /foobar/some-file && umask 002 && touch /foobar/some-other-file'" 47 minutes ago Created elastic_leavitt
8e5cb7596fcd8d05f716f7a9279fb25641253385789fe5a58253b80d15bb9c0d busybox "sh" 6 weeks ago Created bla
7a9c4f4cd3fd0f9498ab86e5184421948657504eda20413e1310029b9066902d thajeztah/f3tsh:latest@sha256:60bc56119e80ff42ec4842e9c749dfa6d3cd1c16102a5988f1dfc610265d4e80 "/f3tsh" 7 weeks ago Exited (2) 2 days ago f3tsh.1.udmq009i4j38nkk0n5obuf9zo
docker ps --filter since=8e5cb7596fcd8d05f716f7a9279fb25641253385789fe5a58253b80d15bb9c0d
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8db9ffcef1f0 thajeztah/f3tsh:latest "/f3tsh" 2 days ago Up 2 days 80/tcp, 443/tcp f3tsh.1.9rb332ygu7t31zbrp0a431q64
Expected behavior
using a
docker ps
before/since filter like:or
With set container name, or ID, should return a list of matching containers
Actual behavior
Both name and ID queries return an error:
Steps to reproduce the behavior
With the following
docker ps
Run a command like
Receive error:
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.)
Physical machine running CoreOS as only operating system (docker version is maintained by them)
Additional Note
A coworker also tried to do the same command on Docker 17.12 on macOS (Docker for mac) and was getting the same error. The command did not work on running nor stopped machines, but previously worked (pre v17 release) in the workflow I'm using.