compose: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 5: ordinal not in range(128)

Ubuntu 14.04 x64

$ docker --version                                                                                                                                                             
Docker version 1.6.0, build 4749651
$ docker-compose --version                                                                                                                                                           
docker-compose 1.2.0

Getting error on $ sudo docker-compose build

$ sudo docker-compose build
Building web...
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 119, in build
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 191, in build
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 475, in build
  File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 300, in build
  File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.utils", line 73, in tar
  File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
  File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
  File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
  File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
  File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
  File "/code/build/docker-compose/out00-PYZ.pyz/os", line 284, in walk
  File "/code/build/docker-compose/out00-PYZ.pyz/posixpath", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 5: ordinal not in range(128)

docker-compose.yml

web:
  build: .
  command: gulp serve
  ports:
    - 3001:3001
  volumes:
    - .:/app
    - /bower_components:./app/bower_components
  volumes_from:
    - bower_components

Dockerfile

FROM ubuntu:14.04

ENV NVM_VERSION 0.24.1
ENV NODE_VERSION 0.12.0
ENV NPM_VERSION 2.5.1

RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v$NVM_VERSION/install.sh | bash \
    && source ~/.bashrc \
    && nvm install $NODE_VERSION \
    && nvm alias default $NODE_VERSION \
    && npm install -g npm@"$NPM_VERSION" gulp bower \

WORKDIR /app

CMD tail -f /dev/null

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 42 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Just hit this and eventually tracked it down to Hipchat messing with copy/past. Manually type a command on one machine and it works. Copy/paste through hipchat to another machine and it fails. Retype the command on the new machine and it works perfectly.

PSA: Slack also changes --no-cache to –no-cache, which will result in the exact same error when copy pasted from there.

@oalbiez Do you mean that when you run docker-compose build --no-cache with docker-compose 1.1.0, the build runs successfully?

I download the latest docker-compose, fix the problem

i have a same problem

$ docker-compose up
Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 85, in main
  File "compose\cli\main.py", line 113, in dispatch
  File "compose\cli\utils.py", line 84, in get_version_info
  File "compose\cli\utils.py", line 105, in get_build_version
  File "ntpath.py", line 85, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcd in position 7: ordinal not in range(128)
Failed to execute script docker-compose

Watch you command line. You must have used some unicode (0xe2 …): for example long unicode ‘–’ instead of ascii ‘-’.

I have the same problem. docker-compose version: 1.5.0 Docker version 1.9.0, build 76d6bc9

Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/code/compose/cli/main.py", line 54, in main
  File "/code/compose/cli/docopt_command.py", line 23, in sys_dispatch
  File "/code/compose/cli/docopt_command.py", line 26, in dispatch
  File "/code/compose/cli/main.py", line 170, in perform_command
  File "/code/compose/cli/main.py", line 588, in up
  File "/code/compose/cli/main.py", line 658, in attach_to_logs
  File "/code/compose/cli/log_printer.py", line 27, in run
  File "/code/compose/cli/multiplexer.py", line 35, in loop
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc2 in position 0: unexpected end of data
docker-compose returned -1

NOTE: withdocker-comose -v 1.1.0-rc2 everything works well