Cha*_*ker 9 linux ubuntu opam docker
我想跑opam init
,但出现错误:
(iit_synthesis) brandomiranda~ \xe2\x9d\xaf docker build -t brandojazz/pycoq:test_brando ~/pycoq/tutorial/\n[+] Building 1.5s (12/19) \n => [internal] load build definition from Dockerfile 0.0s\n => => transferring dockerfile: 2.33kB 0.0s\n => [internal] load .dockerignore 0.0s\n => => transferring context: 2B 0.0s\n => [internal] load metadata for docker.io/library/ubuntu:20.04 0.2s\n => CACHED https://api.github.com/repos/IBM/pycoq/git/refs/heads/main 0.0s\n => [ 1/15] FROM docker.io/library/ubuntu:20.04@sha256:fd92c36d3cb9b1d027c4d2a72c6bf0125da82425fc2ca37c414d4f010180dc19 0.0s\n => CACHED [ 2/15] RUN apt-get update && apt-get install -y --no-install-recommends ssh git m4 libgmp-dev opam wget ca-certificates rsync strace 0.0s\n => CACHED [ 3/15] RUN useradd -m bot 0.0s\n => CACHED [ 4/15] WORKDIR /home/bot 0.0s\n => CACHED [ 5/15] RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh -b -f 0.0s\n => CACHED [ 6/15] RUN conda create -n pycoq python=3.9 -y 0.0s\n => CACHED [ 7/15] ADD https://api.github.com/repos/IBM/pycoq/git/refs/heads/main version.json 0.0s\n => ERROR [ 8/15] RUN apt-get update && apt-get install -y --no-install-recommends bubblewrap 1.2s\n------ \n > [ 8/15] RUN apt-get update && apt-get install -y --no-install-recommends bubblewrap:\n#12 0.237 Reading package lists...\n#12 1.118 E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)\n#12 1.118 E: Unable to lock directory /var/lib/apt/lists/\n------\nexecutor failed running [/bin/sh -c apt-get update && apt-get install -y --no-install-recommends bubblewrap]: exit code: 100\n
Run Code Online (Sandbox Code Playgroud)\n我可以使用(如何将新包安装到非根 Docker 容器中?):
\nUSER root\nRUN apt-get update && apt-get install -y --no-install-recommends bubblewrap\nRUN opam init\n
Run Code Online (Sandbox Code Playgroud)\n但不确定这是否是解决此问题的正确方法。
\n是吗?
\n到目前为止的 Dockerfile:
\nFROM ubuntu:20.04\n\nRUN apt-get update \\\n && apt-get install -y --no-install-recommends \\\n ssh \\\n git \\\n m4 \\\n libgmp-dev \\\n opam \\\n wget \\\n ca-certificates \\\n rsync \\\n strace\n\nRUN useradd -m bot\nWORKDIR /home/bot\nUSER bot\n\nRUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \\\n && bash Miniconda3-latest-Linux-x86_64.sh -b -f\nENV PATH="/home/bot/miniconda3/bin:${PATH}"\nRUN conda create -n pycoq python=3.9 -y\n# somehow this "works" but conda isn\'t fully aware of this. Fix later?\nENV PATH="/home/bot/miniconda3/envs/pycoq/bin:${PATH}"\n\nADD https://api.github.com/repos/IBM/pycoq/git/refs/heads/main version.json\n\n# TODO: doesn\'t seem to work...try later perhaps: /sf/ask/3858654621/\n# TODO: if you run VP\'s image and attack a volume that seems enough for now.\n# RUN conda init bash\n# RUN echo "conda activate pycoq" > ~/.bashrc\n# RUN conda activate pycoq\n#RUN conda update -n base -c defaults conda\n#RUN conda install conda-build\n\n# - setp up opam\n#RUN conda install -c conda-forge opam\n#USER root\nRUN apt-get update && apt-get install -y --no-install-recommends bubblewrap\nRUN opam init\n
Run Code Online (Sandbox Code Playgroud)\n请注意,我确实尝试使用 apt-get update 将其作为一个命令运行,但按照此处的建议失败了Apt-get not working inside ubuntu dockerfile。
\n我还看到:Docker apt-get update 失败但不明白。
\n请注意,这也适用opam init 在 docker 上失败
\nopam init --disable-sandboxing\n
Run Code Online (Sandbox Code Playgroud)\n但不确定这是否正确。
\n小智 1
我在 Dockerfile 方面遇到了与您相同的问题,apt
. 我没有USER
您在原始文件中添加的行,一旦我将其添加到 Dockerfile 中,运行apt
就没有任何问题。我是 Docker 新手,所以我无法告诉你你的解决方案是否是正确答案,但我会保留该USER
行在我的文件中,直到我被告知它是不正确的。在我看来,这是有道理的,因为我sudo
在命令行中使用来运行apt
.
归档时间: |
|
查看次数: |
9998 次 |
最近记录: |