Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

尝试使用docker运行,结果失败了 #6

Open
zeusro opened this issue Oct 10, 2019 · 0 comments
Open

尝试使用docker运行,结果失败了 #6

zeusro opened this issue Oct 10, 2019 · 0 comments

Comments

@zeusro
Copy link
Contributor

zeusro commented Oct 10, 2019

我的dockerfile是

FROM python:alpine
RUN export version=$(cat /etc/alpine-release) && \
    echo https://mirrors.ustc.edu.cn/alpine/v${version%.*}/main > /etc/apk/repositories && \
    echo https://mirrors.ustc.edu.cn/alpine/v${version%.*}/community >> /etc/apk/repositories;\
    echo "Asia/Shanghai" > /etc/timezone ;\
    apk add --virtual .build-deps gcc linux-headers libffi-dev musl-dev; \
    apk del libressl-dev &&\
    apk add openssl-dev && \
    pip install cryptography==2.7 && \
    apk del openssl-dev && \
    apk add libressl-dev && \
    pip install --no-cache-dir  python-dateutil requests[security]  docker -i https://mirrors.aliyun.com/pypi/simple/
ADD sync_images.py /sync_images.py
ENTRYPOINT ["python", "sync_images.py"]

运行结果是

ERROR: for sync  list indices must be integers, not unicode
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.17.1', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 68, in main
    command()
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 121, in perform_command
    handler(command, command_options)
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 952, in up
    start=not no_start
  File "/usr/lib/python2.7/dist-packages/compose/project.py", line 455, in up
    get_deps,
  File "/usr/lib/python2.7/dist-packages/compose/parallel.py", line 70, in parallel_execute
    raise error_to_reraise
TypeError: list indices must be integers, not unicode

对Python不是很熟,一样的代码在mac运行正常,在docker中出现问题,表示很困惑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant