问题
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?
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
回答1:
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
If you really want to be sure that your containers are recreated run the following command:
docker-compose up --build --force-recreate
来源:https://stackoverflow.com/questions/49215640/docker-compose-not-building-because-of-an-error-that-has-been-removed