logging – live log from docker container

logging – live log from docker container

The easiest way if you have the container running and sending logs to stdout, is to use docker attach , here is an example of running a container and attaching to it to see the output

$ docker run -d --name topdemo ubuntu /usr/bin/top -b

$ docker attach topdemo

basically this is the syntax of the command docker attach [OPTIONS] <CONTAINER>

After searching quite a lot(!),
I am using it like this:

NUM=`docker run -d --user 1013830000 -p 4567:4567 container_test:v1`
docker logs -f $NUM
docker stop $NUM

logging – live log from docker container

Leave a Reply

Your email address will not be published.