nss-docker(8)

nss-docker8

Nss module for finding docker containers

Usage

libnss_docker.so.2

Overview

This is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) providing mechanism for finding Docker containers by theirs IDs.

The container names are searched in virtual domain name ".docker".

The Docker API webservice has to be available as /var/run/docker.sock socket for current user. Usually it requires to add the user to "docker" system group.

To activate this NSS module, the "docker" module has to be added to /etc/nsswitch.conf file in "hosts:" line.

It is recommended to put the "docker" module after "files" module and before "dns" module. "[NOTFOUND=return]" setting is recommended before "dns" module to prevent using DNS as fallback if the container ID is not found.

Examples

/etc/nsswitch.conf

hosts: files docker [NOTFOUND=return] dns

Limitations

The container ID can't be longer than "getconf HOST_NAME_MAX" (64 for Linux).

The container ID are case sensitive. It means that "test.docker" and "Test.docker" can return different IP addresses.

Only IPv4 addresses are supported.

Copying

nss-docker is distributed under the GNU Lesser General Public License (LGPL 2.1 or greater).

Releases

Unchanged in 5 releases since Debian 9 (Stretch).

  1. 9–13

Bugs

If you find the bug or want to implement new features, please report it at <https://github.com/dex4er/nss-docker/issues>

Authors

Copyright (c) 2015 Piotr Roszatycki <[email protected]>

From libnss-docker 0.02-1.1+b2 in Debian 13 (Trixie). Parsed by carta from the page's man source.