docker啟動redis報錯
1:C 17 Jun 08:18:04.613 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 17 Jun 08:18:04.613 # Redis version=4.0.14, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 17 Jun 08:18:04.613 # Configuration loaded
這是因為redis.conf
配置文件中daemonize
yes
,
這使得redis是以后台啟動的方式運行的,由於docker容器在啟動時,需要任務在前台運行,否則會啟動后立即退出,因此導致redis容器啟動后立即退出問題.
將redis.conf
中的daemonize
字段改為no
即可