我正在用 RMarkdown 写一篇论文,为了获得更好的可重复性,我想将所有必需的软件容器化在一个奇异容器中。不幸的是,当我尝试安装 TinyTeX (推荐用于 Rmarkdown 并且我更喜欢 TeXLive 不会过度膨胀容器)时,它失败并显示以下错误消息(完整的构建日志粘贴在这里):
Can't locate TeXLive/TLConfig.pm in @INC (you may need to install the TeXLive::TLConfig module) (@INC contains: /~/.TinyTeX/texmf-dist/scripts/texlive /~/.TinyTeX/tlpkg /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ~/.TinyTeX/bin/x86_64-linux/tlmgr line 100.
BEGIN failed--compilation aborted at ~/.TinyTeX/bin/x86_64-linux/tlmgr line 100.
这是构建定义文件,基本上它使用一个非常精简的ubuntu 18.04然后执行%post部分安装软件
BootStrap: library
From: ubuntu:18.04
%post
# Add universe repository
echo "deb http://us.archive.ubuntu.com/ubuntu bionic universe" >> /etc/apt/sources.list
apt -y update
# Install utilites
apt install -y wget
# Install R
apt install -y r-base-core
## Install RMarkdown and TinyTeX
R --slave -e 'install.packages(c("rmarkdown","tinytex")); tinytex::install_tinytex()'
# Clean
apt-get clean
%environment
export LC_ALL="en_US.UTF-8"
%labels
Author DP
我也尝试过tinytex::install_tinytex(dir="/opt/tinytex")
,但这似乎并没有改变任何东西。有谁知道出了什么问题?