Skip to content

Commit 198d8a1

Browse files
committed
fixed backwards compatible name filter
1 parent 8ca5ad4 commit 198d8a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server.coffee

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ options =
3434
privateKey: fs.readFileSync keypath
3535

3636
# support CONTAINER parameter for backwards compatibility
37-
filters = {"name":[container]} if (not filters) and container
37+
# Apparently the name filter also matches on partial names
38+
# It turns out the name filter accepts a regular expression to do an exact match
39+
# See: https://forums.docker.com/t/how-to-filter-docker-ps-by-exact-name/2880
40+
filters = {"name":["^/#{container}$"]} if (not filters) and container
3841
log.info filter: filters, 'Docker filter'
3942

4043
sessionFactory = handlerFactory filters, shell, shell_user

0 commit comments

Comments
 (0)