官方 Repo:https://github.com/RUB-SysSec/dompteur
这么小众的题材肯定没人看了,Github 都没有两颗星,虽然是四大hhh
首先 Clone,按照 readme 执行 ` docker build -t dompteur . `
第一个报错是权限不足,上一篇博客解决了这个问题
接下来是第二个报错,
/usr/bin/env: 'bash\r': No such file or directory
解决方案参照了:
Step 8/15 : RUN chmod a+x extras/check_dependencies.sh && extras/check_dependencies.sh && make -j $(nproc) && ./extras/install_irstlm.sh
---> Running in 90e747f7cf0a
extras/check_dependencies.sh: 1: extras/check_dependencies.sh: !/usr/bin/env: not found
extras/check_dependencies.sh: 12: extras/check_dependencies.sh: function: not found
extras/check_dependencies.sh: 16: extras/check_dependencies.sh: Syntax error: "}" unexpected
首先说 没有这个路径,然后又说语法错误,估计是第一行的问题导致的,那就把第一行改成标准的 bash 文件开头。后来又报错又改回去反倒没有语法错误了。
wget: unable to resolve host address 'jaguar.ncsl.nist.gov'
# 还有很多被我省略了,下载进度和编译命令等
2022-03-09 13:01:47 (296 KB/s) - 'openfst-1.6.7.tar.gz.1' saved [1230836/1230836]
tar xozf openfst-1.6.7.tar.gz
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Makefile:88: recipe for target 'openfst-1.6.7' failed
make: *** [openfst-1.6.7] Error 2
# 还有很多省略
make[3]: Entering directory '/root/kaldi/tools/sctk-2.4.10/src/sclite'
/bin/sh: 5: Syntax error: end of file unexpected (expecting "done")
makefile:171: recipe for target 'testinstalldirs' failed
make[3]: [testinstalldirs] Error 2 (ignored)
破案了,就是网络问题,导致 Github 之类的一些外国服务器上的文件下载出现问题,外国环境可以 build。build 前确保至少能访问 Github 这类网站并且不会掉。
这一段好不容易搞定,安装 python 包又卡住了。
=> ERROR [14/15] RUN pip3 install -r requirements.txt
* 这里我省略了很多不相关信息
#19 99.28 Building wheels for collected packages: pillow, future
#19 99.28 Running setup.py bdist_wheel for pillow: started
#19 99.95 Running setup.py bdist_wheel for pillow: finished with status 'error'
#19 99.95 Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-m4m2gxjc/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp5w911g_upip-wheel- --python-tag cp36:
#19 99.95 /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
#19 99.95 warnings.warn(msg)
#19 99.95 running bdist_wheel
* 这里我省略了很多信息
#19 102.8 During handling of the above exception, another exception occurred:
#19 102.8
#19 102.8 Traceback (most recent call last):
#19 102.8 File "<string>", line 1, in <module>
#19 102.8 File "/tmp/pip-build-m4m2gxjc/pillow/setup.py", line 1037, in <module>
#19 102.8 raise RequiredDependencyException(msg)
#19 102.8 __main__.RequiredDependencyException:
#19 102.8
#19 102.8 The headers or library files could not be found for jpeg,
#19 102.8 a required dependency when compiling Pillow from source.
#19 102.8
#19 102.8 Please see the install instructions at:
#19 102.8 https://pillow.readthedocs.io/en/latest/installation.html
#19 102.8
搜了一下解决方案如下:
python - "The headers or library files could not be found for jpeg" installing Pillow on Alpine Linux - Stack Overflowhttps://stackoverflow.com/questions/44043906/the-headers-or-library-files-could-not-be-found-for-jpeg-installing-pillow-on加入了一行 `RUN apt install -y libjpeg-dev zlib1g-dev ` ,(不加 -y 的话会提示操作,导致脚本继续报错),之后的 Dockerfile 部分如下。
# Build Kaldi
ADD kaldi/src /root/kaldi/src
WORKDIR /root/kaldi/src
RUN ./configure --shared &&\
make depend -j $(nproc) &&\
make -j $(nproc) || true
WORKDIR /root
ADD requirements.txt /root/requirements.txt
RUN apt install -y libjpeg-dev zlib1g-dev
RUN pip3 install -r requirements.txt
ADD kaldi/wsj_recipe /root/kaldi/wsj_recipe
再次 Build 终于成功了,激动之情难以言表啊
跑起来了,但是好像 Windows 的 Docker Desktop 不能调整 image 的存储路径……需要搞什么 WSL2 的配置,然后我想把它的 image 单独拿出来存储结果发现和别的 image 是一起存放在一个超级大文件里的。。。