首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >权限被拒绝docker Mac Os M1

权限被拒绝docker Mac Os M1
EN

Stack Overflow用户
提问于 2021-01-27 09:32:19
回答 1查看 322关注 0票数 0

我对docker非常陌生,总是遇到“权限被拒绝”的问题。我能够使用下面的docker文件构建一个镜像:

代码语言:javascript
复制
FROM tensorflow/tensorflow:latest

ENV DEBIAN_FRONTEND=noninteractive

# Python

RUN apt-get update -y && apt-get upgrade -y &&\
    apt-get install python-opencv -y &&\
    pip install -U pip setuptools

RUN pip install keras jupyter && \
    pip install ipdb pytest pytest-cov python-coveralls coverage==3.7.1 pytest-xdist pep8 pytest-pep8 pydot_ng jupyter && \
    pip install Pillow scikit-learn notebook matplotlib nose pyyaml six h5py pandas scikit-image python-resize-image glob2 && \
    pip install opencv-python && \
    pip install --upgrade tensorflow-gpu tensorflow-probability

# COPY ST2inJupyter.js ~/.jupyter/custom/custom.js #this does not work.  put explicit abs path on image (abs path for files in directories outside Dockerfile do not work currently)
# Set up our notebook config.

COPY jupyter_notebook_config.py /root/.jupyter/
ADD startup /src/startup

ENV PYTHONPATH='/src/:$PYTHONPATH'

WORKDIR /src

#Configure Jupyter notebook port exposure
EXPOSE 8888

# For CUDA profiling, TensorFlow requires CUPTI.
ENV LD_LIBRARY_PATH \usr\local\cuda\extras\CUPTI\lib64:$LD_LIBRARY_PATH

# TensorBoard (only needed for visualizing lower level TF models.  in keras, not really too helpful, but just keep in)
EXPOSE 6006

# Define startup bash script in external file (loaded via ADD or COPY above)
CMD /src/startup

当我运行docker镜像:docker run -v ${PWD}:/src/hostpwd -it -p 8888:8888 [image_name]时,我一直收到"Permission Denied“错误。下面是它看起来的样子:

/bin/sh: 1: /src/startup: Permission denied

有人能帮我解决这个问题吗?我有一台Mac,还有新M1芯片的预览版docker。

EN

回答 1

Stack Overflow用户

发布于 2021-03-19 23:34:20

从注释,如下所示的工作代码

代码语言:javascript
复制
FROM tensorflow/tensorflow:latest

ENV DEBIAN_FRONTEND=noninteractive

# Python

RUN apt-get update -y && apt-get upgrade -y &&\
    apt-get install python-opencv -y &&\
    pip install -U pip setuptools

RUN pip install keras jupyter && \
    pip install ipdb pytest pytest-cov python-coveralls coverage==3.7.1 pytest-xdist pep8 pytest-pep8 pydot_ng jupyter && \
    pip install Pillow scikit-learn notebook matplotlib nose pyyaml six h5py pandas scikit-image python-resize-image glob2 && \
    pip install opencv-python && \
    pip install --upgrade tensorflow-gpu tensorflow-probability

# COPY ST2inJupyter.js ~/.jupyter/custom/custom.js #this does not work.  put explicit abs path on image (abs path for files in directories outside Dockerfile do not work currently)
# Set up our notebook config.

COPY jupyter_notebook_config.py /root/.jupyter/
ADD startup /src/startup

ENV PYTHONPATH='/src/:$PYTHONPATH'

WORKDIR /src

#Configure Jupyter notebook port exposure
EXPOSE 8888

# For CUDA profiling, TensorFlow requires CUPTI.
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH

# TensorBoard (only needed for visualizing lower level TF models.  in keras, not really too helpful, but just keep in)
EXPOSE 6006

# Define startup bash script in external file (loaded via ADD or COPY above)
CMD /src/startup    

(改写自chepner)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65911683

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档