将 LaTeX 安装到 Google 的 Debian8 docker 镜像中

将 LaTeX 安装到 Google 的 Debian8 docker 镜像中

我正在尝试弄清楚如何安装 LaTeX(具体来说,这个 texlive 包)到 Google 的 Debian8 Docker 镜像中,该镜像称为gcr.io/google-appengine/debian8.我希望能提供一个链接,但我在 Docker 或 GitHub 上找不到它。事实上,我正在使用这个图片是从它间接衍生出来的。

如果我尝试将其安装到映像中,则会出现错误:

> apt-get install texlive
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package texlive

我怀疑我需要向 apt 源添加适当的源(可能还有密钥),但我不知道如何弄清楚到底是什么。我相信我最终会得到一个与此类似的 Docker 命令(但可能更简单):

RUN \
  apt-get -q update && apt-get install --no-install-recommends -y -q curl git ca-certificates apt-transport-https openssh-client && \
  curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
  curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \
  curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list && \
  apt-get update && \
  apt-get install dart=$DART_VERSION-1 && \
rm -rf /var/lib/apt/lists/*

有人能在这里指出正确的方向吗?如何确定需要添加哪些内容/etc/apt/sources才能使texlive包显示出来?

答案1

一个例子泊坞窗在 **macos 10.14 ** 上,您可以使用 bash 启动映像。

MacBook-Pro:~ em$ docker run -it gcr.io/google-appengine/debian8 /bin/bash

您尝试安装文字直播

root@6b616ce25c70:/# apt-get install -d  texlive
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package texlive

Google 提供的镜像被剥离,因此许多临时文件被删除。

所以你必须跑apt-get 更新

root@6b616ce25c70:/# apt-get update
Ign http://httpredir.debian.org jessie InRelease
Get:1 http://httpredir.debian.org jessie-updates InRelease [145 kB]
Get:2 http://security.debian.org jessie/updates InRelease [44.9 kB]
Get:3 http://httpredir.debian.org jessie Release.gpg [2420 B]
Get:4 http://httpredir.debian.org jessie Release [148 kB]
Get:5 http://httpredir.debian.org jessie-updates/main amd64 Packages [23.0 kB]
Get:6 http://security.debian.org jessie/updates/main amd64 Packages [818 kB]
Get:7 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.3 MB in 9s (1132 kB/s)
Reading package lists... Done

现在你可以运行 apt-get 安装 texlive

root@6b616ce25c70:/# apt-get install -d  texlive
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  cpp cpp-4.9 dbus file fontconfig fontconfig-config 
  .../...
Suggested packages:
  cpp-doc gcc-4.9-locales dbus-x11 ghostscript-x apache2 
  ../..  
Recommended packages:
  libarchive-tar-perl wish
The following NEW packages will be installed:
  cpp cpp-4.9 dbus file fontconfig 
  ../..  
The following packages will be upgraded:
  gcc-4.9-base libgcc1 libstdc++6
3 upgraded, 253 newly installed, 0 to remove and 11 not upgraded.
Need to get 441 MB of archives.
After this operation, 897 MB of additional disk space will be used.
Do you want to continue? [Y/n]

相关内容