randytan
randytan

Reputation: 1039

Docker Run Failed Due to --log-opts

I am running a docker run command to spawn a new container. The command I gave:

docker run -h 'activemq1' --net bridge -m 20g --env-file /opt/dockerenv/activemq-1/env.txt -p 8161:8161 -p 61613:61613 -p 61614:61614 -p 61616:61616 -p 1616:1616 -p 5672:5672 -p 1883:1883 -v /opt/dckexchange:/exchange -v /etc/yum.repos.d:/etc/yum.repos.d -v /mnt/data/volumes/activemq1/data:/usr/share/activemq/data --log-opt max-size=1g --log-opt max-file=2 --name activemq-dev mydocker:5000/activemq/activemq:latest

It should be running perfectly without error, but apparently it throws me an error unknown flag: --log-opts. It is running ok if I remove all of the log-opt command.

Docker version: 1.13.1

Any ideas?

Upvotes: 2

Views: 3452

Answers (1)

Ryan.Bartsch
Ryan.Bartsch

Reputation: 4200

Maybe you're missing the log-driver e.g.

--log-driver json-file --log-opt max-size=1g --log-opt max-file=2

I think you need this unless you've specified a default in /etc/docker/daemon.json

Upvotes: 1

Related Questions