3

I am running my nodejs and blockchain code . And I made a Docker Container with dockerfile and docker compose but i am getting error while running the docker-compose up.

This is the traceback on console :

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose/cli/main.py", line 68, in main
  File "compose/cli/main.py", line 121, in perform_command
  File "compose/cli/main.py", line 938, in up
  File "compose/project.py", line 430, in up
  File "compose/service.py", line 317, in ensure_image_exists
  File "compose/service.py", line 918, in build
  File "site-packages/docker/api/build.py", line 238, in build
  File "site-packages/docker/api/build.py", line 285, in _set_auth_headers
  File "site-packages/docker/auth.py", line 97, in resolve_authconfig
  File "site-packages/docker/auth.py", line 125, in _resolve_authconfig_credstore
  File "site-packages/dockerpycreds/store.py", line 25, in get
  File "site-packages/dockerpycreds/store.py", line 57, in _execute
  File "subprocess.py", line 711, in __init__
  File "subprocess.py", line 1343, in _execute_child
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
Failed to execute script docker-compose

and my docker-compose.yml is :

version: '2'
services:
  node-app:
    build: app
    ports:
      - "4000:8080"
    volumes:
      - ./app/src:/myapp/src
    depends_on:
      - ethernet_server
    environment:
      - ETHEREUM_CLIENT_IP=http://192.168.178.22
      - ETHEREUM_CLIENT_PORT=8545

  ethernet_server:
    build: testrpc

I don't know what went wrong.can someone help me to fix it?

4
  • Does your username or password contain a non-ASCII character? Commented Oct 30, 2017 at 11:18
  • no, it has only ASCII characters Commented Oct 30, 2017 at 11:20
  • Did you copy&pasted your line 6? Try to delete the whole line (and line breaks) and re-type it in manually. Commented Oct 30, 2017 at 12:03
  • What is the output of docker-compose config in the current directory? Commented Oct 30, 2017 at 12:38

3 Answers 3

5

Paste the below mentioned lines in your docker file. And it will fix the unicode error.

RUN apt-get update -y
RUN apt-get install --reinstall -y locales
# uncomment chosen locale to enable it's generation
RUN sed -i 's/# pl_PL.UTF-8 UTF-8/pl_PL.UTF-8 UTF-8/' /etc/locale.gen
# generate chosen locale
RUN locale-gen pl_PL.UTF-8
# set system-wide locale settings 
ENV LANG pl_PL.UTF-8
ENV LANGUAGE pl_PL
ENV LC_ALL pl_PL.UTF-8
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I had a similar error when running gdb inside a container. Uncommenting the en_US.UTF-8 line in /etc/locale.gen, and running locale-gen afterwards has fixed the problem. Note though that I already had en_US.UTF-8 in my LANG variable.
1

Try building the containers directly with docker:

docker build app

docker build testrpc

then run your docker-compose again.

I was encountering a similar report from docker-compose of UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0 and found that using docker to rebuild my containers resolved the problem.

Comments

0

In my case, while saving docker commands i had saved it as a .odt file initially and then changed the file extension in finder app to .yml manually, resulted in above issue.

Used VS code (you can use any other tool or simply select all files as format type while saving) to save the file with .yml extension and then tried executing docker-compose again worked for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.