Docker
docker-compose can specify one or multiple yml files, also about config option.
config option.docker-compose -f docker-compose-dev.yml upspecify yml file.
docker-compose -f docker-compose-base.yml -f docker-compose-dev.yml upmultiple -f can merge multiple yml file. Different parts will be merged, and for overlapped parts, later file will override former files.
docker-compose -f docker-compose-base.yml -f docker-compose-dev.yml configdocker-compose <...> config can display final config structure.
Why I cannot catch docker-compose down signal
I write a python code, to catch terminate signal,
import signal
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGWINCH, signal_handler)
signal.signal(signal.SIGINT, signal_handler)However I found using docker-compose down, the program cannot catch the signal. very confusing. then found this article.
copy:
https://www.evernote.com/l/AB1zfELghxNLSZXbqeBgkx_mbQAQFsGktd0/
Summary
Use the exec/JSON array form of
ENTRYPOINT.Use
execin shell entrypoints.Don’t pipe your application’s output.
Avoid being PID 1.
Listen for
SIGTERMor setSTOPSIGNALin your Dockerfile.
Most ignore part is exec one:
So instead of
do
Last updated
Was this helpful?