小编chu*_*iti的帖子

Amazon EC2中的Docker部署错误 - Docker容器意外退出

我正在尝试在Amazon EC2中部署Dockerfile和Dockerrun.aws.json.我能够成功创建Docker容器但在此之后,实例崩溃了.我不知道为什么 Docker容器意外退出或如何解决它.

日志:

    Step 36 : RUN service apache2 stop && service apache2 start
       ---> Running in 1531cdba4bf1
    Stopping web server: apache2.
    [91m/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not  permitted)
    [0m[91mSetting ulimit failed. See README.Debian for more information.
    [0m[91mAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.32. Set the 'ServerName' directive globally to suppress this message
    [0mStarting web server: apache2.

   ---> 86403887587f
  Removing intermediate container 1531cdba4bf1
  Step 37 : EXPOSE …
Run Code Online (Sandbox Code Playgroud)

apache amazon-ec2 amazon-web-services docker dockerfile

4
推荐指数
1
解决办法
2664
查看次数

如果是内联的Python则继续

我一直无法找到继续/传递if for a for,any ideas的技巧?请不要提供显式循环作为解决方案,它应该是一行中的所有内容.

我用continue,pass测试了代码,只有当...

list_num=[1,3]
[("Hola"  if i == 1 else continue)  for i in list_num]
Run Code Online (Sandbox Code Playgroud)

我的试验输出:

[("Hola"  if i == 1 else continue)  for i in list_num]
                                    ^
SyntaxError: invalid syntax


File "<stdin>", line 1
    [("Hola"  if i == 1 else pass)  for i in list_num]
                                ^
SyntaxError: invalid syntax



File "<stdin>", line 1
    [(if i == 1: "Hola")  for i in list_num]
   ^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)

python syntax-error

4
推荐指数
1
解决办法
2746
查看次数