我准备安装 EDX 的 Compiler 课程的配置环境。找到了一个 Docker 仓库:https://github.com/ThomasPinna/edx-compilers。
但是我按照它的步骤进行配置的时候报错:
执行
docker build -t coolc .
执行结果 + 报错:
[+] Building 4.6s (6/11)
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 572B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:14.04 3.5s
=> [1/8] FROM docker.io/library/ubuntu:14.04@sha256:64483f3496c1373bfd55348e88694d1c4d0c9b66 0.0s
=> CACHED [2/8] RUN apt-get update 0.0s
=> ERROR [3/8] RUN apt-get install libc6-i386 1.0s
------
> [3/8] RUN apt-get install libc6-i386:
#0 0.359 Reading package lists...
#0 0.956 Building dependency tree...
#0 1.025 Reading state information...
#0 1.042 E: Unable to locate package libc6-i386
------
Dockerfile:4
--------------------
2 |
3 | RUN apt-get update
4 | >>> RUN apt-get install libc6-i386
5 |
6 | RUN apt-get install -y flex bison build-essential \
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get install libc6-i386" did not complete successfully: exit code: 100
下面是我尝试过的解决办法
- 我尝试修改 /etc/docker/daemon.json,使用了国内的镜像(阿里云),无法解决。
- 我尝试走代理,在 Dockerfile 内部加了下面三行,还是不行:
RUN export https_proxy=http://0.0.0.0:7890
RUN http_proxy=http://0.0.0.0:7890
RUN all_proxy=socks5://0.0.0.0:7890
- 上一步的 0.0.0.0 换成本地 IP,依然不行
我该如何解决这个问题?
ubuntu 版本
[1/3] FROM docker.io/library/ubuntu:14.04@sha256:64483f3496c1373bfd55348e88694d1c4d
下面是我运行 docker images 的结果:
REPOSITORY TAG IMAGE ID CREATED SIZE
coolc latest 8b1447ab5522 51 minutes ago 201MB
docker/getting-started latest 289dc403af49 3 months ago 46.5MB
arminfriedl/lukewarm latest b658353e662b 2 years ago 1.31GB
docker -v :
Docker version 23.0.1, build a5ee5b1dfc
cat /etc/docker/daemon.json:
{
"registry-mirrors": ["https://registry.cn-hangzhou.aliyuncs.com", "https://mirror.ccs.tencentyun.com", "https://registry.docker-cn.com"]
}
ubuntu 14.04已经很老了,可能需要更新一下源。或者试试更新版本的ubuntu镜像能不能正常使用
===
错误提示是
Unable to locate package libc6-i386
仓库里面没有这个包,如果是这样的话,大概率和代理没关系,就是默认的软件源有问题。
===
问题可能在这里:
这里可能是用的缓存,缓存不是最新的,可以试试在这里前面任意加一行东西,比如
RUN echo xxx
===