我正在尝试使用docker和fig部署并运行我的django应用程序,我遇到了以下错误。
TypeError: create_container() takes at least 2 arguments (3 given)
这是整个错误日志以及fig和docker文件。 (大多数细节如密码都是测试细节,因为我只是想让docker,fig和我的示例应用程序运行)。
有关如何解决此问题的任何建议? 有没有办法进一步调试(可能使用pdb)来查看create_container()调用的确切参数?
Error log
Traceback (most recent call last):
File "/usr/local/bin/fig", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/fig/cli/main.py", line 31, in main
command.sys_dispatch()
File "/usr/local/lib/python2.7/dist-packages/fig/cli/docopt_command.py", line 21, in sys_dispatch
self.dispatch(sys.argv[1:], None)
File "/usr/local/lib/python2.7/dist-packages/fig/cli/command.py", line 28, in dispatch
super(Command, self).dispatch(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/fig/cli/docopt_command.py", line 24, in dispatch
self.perform_command(*self.parse(argv, global_options))
File "/usr/local/lib/python2.7/dist-packages/fig/cli/command.py", line 56, in perform_command
handler(project, command_options)
File "/usr/local/lib/python2.7/dist-packages/fig/cli/main.py", line 427, in up
insecure_registry=insecure_registry,
File "/usr/local/lib/python2.7/dist-packages/fig/project.py", line 174, in up
for (_, container) in service.recreate_containers(insecure_registry=insecure_registry):
File "/usr/local/lib/python2.7/dist-packages/fig/service.py", line 199, in recreate_containers
container = self.create_container(insecure_registry=insecure_registry, **override_options)
File "/usr/local/lib/python2.7/dist-packages/fig/service.py", line 178, in create_container
return Container.create(self.client, **container_options)
File "/usr/local/lib/python2.7/dist-packages/fig/container.py", line 37, in create
response = client.create_container(**options)
图文件
dbdata:
image: postgres:latest
volumes:
- /var/lib/postgres
command: true
db:
volumes_from:
- dbdata
ports:
- "5432"
web:
build: .
command: python manage.py runserver 0.0.0.0.8000
volumes:
- .:/usr/src/app
ports:
- "8000:8000"
links:
- db
environment:
- INSTANCE_TYPE=web
- DEBUG = 1
- DJANGO_SETTINGS_MODULE=django_project.settings
- DATABASE_URL=postgres://postgres@db/postgres
Dockerfile
FROM python:2.7.8
MAINTAINER xyz
EXPOSE 8000
RUN mkdir -p /usr/src/app
RUN pip install -r /usr/src/requirements.txt
ENV DJANGO_SETTINGS_MODULE django_project.settings
ENV DATABASE_URL postgres://postgres@db/postgres
WORKDIR /usr/src/app
CMD [ "python", "manage.py", "runserver", "0.0.0.0:8000" ]