I started to use docker since few days and I wanted to create a new project with multiple containers, so I tried docker-compose but when I try to launch docker-compose run river I have this stack trace :
Traceback (most recent call last):
File "/bin/docker-compose", line 9, in <module>
load_entry_point('docker-compose==1.3.0', 'console_scripts', 'docker-compose')()
File "/usr/lib/python3.4/site-packages/compose/cli/main.py", line 31, in main
command.sys_dispatch()
File "/usr/lib/python3.4/site-packages/compose/cli/docopt_command.py", line 21, in sys_dispatch
self.dispatch(sys.argv[1:], None)
File "/usr/lib/python3.4/site-packages/compose/cli/command.py", line 34, in dispatch
super(Command, self).dispatch(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/compose/cli/docopt_command.py", line 24, in dispatch
self.perform_command(*self.parse(argv, global_options))
File "/usr/lib/python3.4/site-packages/compose/cli/command.py", line 66, in perform_command
handler(project, command_options)
File "/usr/lib/python3.4/site-packages/compose/cli/main.py", line 304, in run
insecure_registry=insecure_registry,
File "/usr/lib/python3.4/site-packages/compose/project.py", line 226, in up
for service in services
File "/usr/lib/python3.4/site-packages/compose/project.py", line 230, in <listcomp>
do_build=do_build,
File "/usr/lib/python3.4/site-packages/compose/service.py", line 320, in execute_convergence_plan
do_build=do_build,
File "/usr/lib/python3.4/site-packages/compose/service.py", line 215, in create_container
previous_container=previous_container,
File "/usr/lib/python3.4/site-packages/compose/service.py", line 510, in _get_container_create_options
config_hash = self.config_hash()
File "/usr/lib/python3.4/site-packages/compose/service.py", line 398, in config_hash
return json_hash(self.config_dict())
File "/usr/lib/python3.4/site-packages/compose/utils.py", line 8, in json_hash
h.update(dump)
TypeError: Unicode-objects must be encoded before hashing
Here's my docker-compose.yml :
river:
build: .
volumes: ./code
command: python main/main.py
links:
- es
- db
kibana:
image: kibana
ports:
- "5601:5601"
links:
- es
db:
image: mysql
ports:
- "3306:3306"
es:
image: elasticsearch
ports:
- "9002:9002"
Edit
Here's my Dockerfile
FROM python:3.4
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
Thanks for the future help :)
docker-compose does not support python3. You need to run and install it with python2.7.