Skip to content

Docker container prints log messages to stdout #2293

Description

@jayhendren

I am attempting to use the keeper/commander Docker container in order to fetch secrets in a non-interactive script. However, in addition to the output that I actually care about, the container also prints diagnostic log messages to stdout:

$ docker run --volume ~/.keeper:/home/commander/.keeper local/keeper-commander get --format password "$UID" 2>/dev/null
[2026-08-14 18:23:05] Config file found at /home/commander/.keeper/config.json, using config-based authentication
********
[2026-08-14 18:23:11] Performing cleanup on exit...
[2026-08-14 18:23:11] Cleanup completed
$

This makes it difficult to separate the output of the containerized keeper get command from the informational log messages.

By comparison, the non-containerized version of keeper get produces clean output that can be easily used in a script:

$ keeper get --format password "$UID"
********
$

I am not sure if I am using the container in an unintended way, or if there is some other method to get clean output from the container? I don't see any usage instructions/docs for the container anywhere.

FWIW, I was able to get the behavior I wanted by adding a stderr redirect to the log function in docker-entrypoint.sh. I changed the following line:

echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"

to:

    echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" >&2

Then, after rebuilding the image, the same command as above returned clean output; I was able to use a stderr redirect to get rid of the unwanted log messages:

$ docker run --volume ~/.keeper:/home/commander/.keeper local/keeper-commander get --format password "$UID" 2>/dev/null
********
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions