hyperledger-archives / indy-sdk

indy-sdk
https://wiki.hyperledger.org/display/indy
Apache License 2.0
669 stars 735 forks source link

docker-compose up failed to start #2443

Closed leostereo closed 9 months ago

leostereo commented 3 years ago

hi guys , this is happening on my ubuntu 20.04 platform

root@ubuntu-vm:/opt/docker-compose/indy-sdk/docs/getting-started# docker-compose up
Building jupyter
Sending build context to Docker daemon  216.6kB
Step 1/9 : FROM ubuntu:16.04
 ---> b6f507652425
Step 2/9 : RUN useradd -ms /bin/bash indy
 ---> Using cache
 ---> 3eae3a9c51ff
Step 3/9 : RUN apt-get update -y && apt-get install -y  wget    python3.5       python3-pip     python-setuptools       apt-transport-https     ca-certificates         software-properties-common
 ---> Using cache
 ---> e48aa53b61fa
Step 4/9 : WORKDIR /home/indy
 ---> Using cache
 ---> 13a20c29f140
Step 5/9 : RUN pip3 install --upgrade pip
 ---> Using cache
 ---> e076c60532c6
Step 6/9 : RUN pip3 install -U  pip     ipython-notebook       ipython==7.9     setuptools      jupyter         python3-indy==1.11.0
 ---> Running in b090b9b16c20
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
The command '/bin/sh -c pip3 install -U         pip     ipython-notebook       ipython==7.9     setuptools      jupyter         python3-indy==1.11.0' returned a non-zero code: 1
ERROR: Service 'jupyter' failed to build : Build failed

Any ideas ? Leandro.

xoryouyou commented 3 years ago

Format strings as used in sys.stderr.write(f"ERROR: {exc}") have been added in python 3.6

https://docs.python.org/3/whatsnew/3.6.html#pep-498-formatted-string-literals

But the image is being build with python 3.5 as you can see here https://github.com/hyperledger/indy-sdk/blob/113b79cd64a238130d20e19b972326f72047c550/docs/getting-started/getting-started.dockerfile#L8

I've made a PR a while back https://github.com/hyperledger/indy-sdk/pull/2423 fixing another issue but I've bumped the python version in there to 3.7

You can take the getting-started.dockerfile from here https://github.com/xoryouyou/indy-sdk/blob/1efe5cace9cfbf8c8a28ae53ee03eb8615c29cda/docs/getting-started/getting-started.dockerfile

It would be great if someone from the team could take a look at the issues and merge the Dockerfile.

eliasschoof commented 2 years ago

I had the same issue as @leostereo. Applying the changes made to the Dockerfile in #2423 by @xoryouyou fixed it.