由于--log-opts,Docker运行失败

时间:2019-10-08 10:21:31

标签: docker docker-registry docker-run

我正在运行docker run命令以生成新容器。我给的命令:

public class PersonDetails
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public DateTime DateTime { get; set; }
}


const string queueName = @".\private$\PersonQueue";

public void GetMessageFromQueue(string queueName)
{
MessageQueue perosnMessageQueue = new MessageQueue(queueName);
try
 {
 XmlMessageFormatter xmlMessageFormatter = new XmlMessageFormatter(new Type[] { 
                                   (typeof(PersonDetails)) });
 perosnMessageQueue.Formatter = xmlMessageFormatter;
 perosnMessageQueue.Refresh();
 for (int i = perosnMessageQueue.GetAllMessages().Count(); i !=0; i--)
 {
   var personDetailsFromQueue =
   (PersonDetails)perosnMessageQueue.Receive
   (MessageQueueTransactionType.Automatic).Body;

    Console.WriteLine("FistName : {0} \n LastName : {1} \n Date Time : 
             {2}",personDetailsFromQueue.FirstName, 
                  personDetailsFromQueue.LastName, 
                  personDetailsFromQueue.DateTime);`  
   }

它应该完美运行,没有错误,但是显然它给我抛出了一个错误未知标志:-log-opts。如果删除所有log-opt命令,一切正常。

Docker版本:1.13.1

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

也许您缺少日志驱动程序,例如

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

除非您在/etc/docker/daemon.json中指定了默认值,否则我认为您需要这样做