由于已删除的错误,Docker compose 未构建 [英] Docker compose not building because of an error that has been removed

查看:20
本文介绍了由于已删除的错误,Docker compose 未构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在包含 Docker compose Dockerfile 的目录中使用命令 docker-compose up 时,我遇到了以下错误.错误是在 acp times 应用程序中有一个额外的大括号,我删除了它.当我再次尝试运行容器时,我收到相同的错误消息,这是为什么呢?

When I use the command docker-compose up in the directory that has the Docker compose Dockerfile, I am hit with the error below. The error was that in acp times app there was an extra brace, which I removed. When I try to run the container again I get the same error message, why is this?

我是 docker 新手,如果需要任何其他信息来帮助解决问题,请告诉我,我什至不确定我在寻找什么,我按照 docker docks 的简单说明进行操作.会不会是我的 python 代码中的其他内容不正确?

I am new to docker, if any additional info is needed to help solve the problem let me know, I'm not even sure what I am looking for, I followed the docker docks simple instructions. Could it be that something else in my python code is incorrect?

Attaching to brevets_web_1 
web_1  | Traceback (most recent call last):
web_1  |   File "flask_brevets.py", line 10, in <module>
web_1  |     import acp_times  # Brevet time calculations
web_1  |   File "/app/acp_times.py", line 18
web_1  |     minTable = [(1300,26), (1000,13.333)), (600, 11.428), 
(400, 15), (200, 15)] 
web_1  |                                         ^
web_1  | SyntaxError: invalid syntax
brevets_web_1 exited with code 1

推荐答案

就像@avigil 说的你需要重建你的图像才能更新它.

Like @avigil said you need to rebuild your image in order to update it.

如果你想在一个命令中完成,你可以输入:

If you want to do it in one command you can type:

docker-compose up --build

docker-compose up --build

如果您真的想确保重新创建容器,请运行以下命令:

If you really want to be sure that your containers are recreated run the following command:

docker-compose up --build --force-recreate

docker-compose up --build --force-recreate

这篇关于由于已删除的错误,Docker compose 未构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆