2016-12-07 42 views
1

我停止使用泊塢窗而不是重新啓動和建設

docker-compose stop celery 

我芹菜但是,當我嘗試再次啓動它,並選中PS它不是重新啓動

docker-compose ps 

radar_celery_1  celery worker -l info -A r ... Exit 1            
radar_data_1  true        Restarting           
radar_nginx_1  /usr/sbin/nginx     Up   0.0.0.0:80->80/tcp      
radar_postgres_1 /docker-entrypoint.sh postgres Up   5432/tcp         
radar_rabbitmq_1 docker-entrypoint.sh rabbi ... Up   25672/tcp, 4369/tcp, 5671/tcp, 5672/tcp 
radar_radar_1  bash -c /usr/local/bin/gun ... Up   0.0.0.0:8002->8000/tcp     
radar_redis_1  docker-entrypoint.sh redis ... Up   6379/tcp         

,當我嘗試重新構建它,有消息錯誤

docker-compose up 
Attaching to radar_celery_1 
celery_1 | Traceback (most recent call last): 
celery_1 | File "/usr/local/bin/celery", line 11, in <module> 
celery_1 |  sys.exit(main()) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/__main__.py", line 30, in main 
celery_1 |  main() 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/celery.py", line 81, in main 
celery_1 |  cmd.execute_from_commandline(argv) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/celery.py", line 793, in execute_from_commandline 
celery_1 |  super(CeleryCommand, self).execute_from_commandline(argv))) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/base.py", line 311, in execute_from_commandline 
celery_1 |  return self.handle_argv(self.prog_name, argv[1:]) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/celery.py", line 785, in handle_argv 
celery_1 |  return self.execute(command, argv) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/celery.py", line 717, in execute 
celery_1 | ).run_from_argv(self.prog_name, argv[1:], command=argv[0]) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/worker.py", line 179, in run_from_argv 
celery_1 |  return self(*args, **options) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/base.py", line 274, in __call__ 
celery_1 |  ret = self.run(*args, **kwargs) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/bin/worker.py", line 212, in run 
celery_1 |  state_db=self.node_format(state_db, hostname), **kwargs 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/worker/__init__.py", line 95, in __init__ 
celery_1 |  self.app.loader.init_worker() 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/loaders/base.py", line 128, in init_worker 
celery_1 |  self.import_default_modules() 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/loaders/base.py", line 116, in import_default_modules 
celery_1 |  signals.import_modules.send(sender=self.app) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/utils/dispatch/signal.py", line 166, in send 
celery_1 |  response = receiver(signal=self, sender=sender, **named) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/amqp/utils.py", line 42, in __call__ 
celery_1 |  self.set_error_state(exc) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/amqp/utils.py", line 39, in __call__ 
celery_1 |  **dict(self.kwargs, **kwargs) if self.kwargs else kwargs 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/app/base.py", line 330, in _autodiscover_tasks 
celery_1 |  self.loader.autodiscover_tasks(packages, related_name) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/loaders/base.py", line 252, in autodiscover_tasks 
celery_1 |  related_name) if mod) 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/loaders/base.py", line 273, in autodiscover_tasks 
celery_1 |  return [find_related_module(pkg, related_name) for pkg in packages] 
celery_1 | File "/usr/local/lib/python2.7/site-packages/celery/loaders/base.py", line 299, in find_related_module 
celery_1 |  return importlib.import_module('{0}.{1}'.format(package, related_name)) 
celery_1 | File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module 
celery_1 |  __import__(name) 
celery_1 | File "/usr/src/app/provider/GG/tasks.py", line 30, in <module> 
celery_1 |  class GGFetchBR(PeriodicSet, PeriodicTask): 
celery_1 | File "/usr/src/app/provider/GG/tasks.py", line 47, in GGFetchBR 
celery_1 |  time = json.loads(config_parser.get('GG', 'time')) 
celery_1 | File "/usr/local/lib/python2.7/ConfigParser.py", line 618, in get 
celery_1 |  raise NoOptionError(option, section) 
celery_1 | ConfigParser.NoOptionError: No option 'time' in section: 'GG' 
radar_celery_1 exited with code 1 

我試過它運行它,但這是響應

(radar) Deans-MacBook-Pro:ci-radar deanchristianarmada$ docker exec -it radar_celery_1 bash 
Error response from daemon: Container 358de1322d8ac62c8307ac704e02d03454eb79fbdd9ad44d57365c0978920658 is not running 

那麼,我該如何解決這個問題呢?我想修復導致我的python文件錯誤的那一個

+0

你可以強制與「泊塢窗,撰寫構建--force-重新創建」重新 – mahen3d

+0

我猜d這將創建每個圖像..是否有可能重新創建我的芹菜圖像? –

+0

不幸的重新創建沒有工作 –

回答

0

我實際上通過將文件複製到該容器來解決它。因此,它是可能的,即使該容器未運行

1.複製文件)首先檢查集裝箱的ID,使用-a查看所有的容器甚至那些沒有運行

docker ps -a 

2)複製需要改變

docker-compose cp file <container_id>:/the/path/to/file 

3.文件)開始嘗試或重新構建圖像