需求描述
为了使得安装的latex不影响系统的稳定性,同时兼顾学习docker的目的,本次环境构建需要满足需求如下:
1、docker进行latex环境隔离
2、latex的数据文件全部在host上进行编辑,可以利用host提供的ide环境
3、挂载host目录给docker进行进行编译
实施步骤一:下载docker镜像
jeffray@jeffray:~$ sudo docker pull ubuntu:18.04
18.04: Pulling from library/ubuntu
c64513b74145: Pull complete
01b8b12bad90: Pull complete
c5d85cf7a05f: Pull complete
b6b268720157: Pull complete
e12192999ff1: Pull complete
Digest: sha256:3f119dc0737f57f704ebecac8a6d8477b0f6ca1ca0332c7ee1395ed2c6a82be7
Status: Downloaded newer image for ubuntu:18.04
查看下载的镜像
jeffray@jeffray:~$ sudo docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu 18.04 735f80812f90 7 days ago 83.5MB
ubuntu 16.04 e13f3d529b1a 2 weeks ago 115MB
hello-world latest e38bc07ac18e 3 months ago 1.85kB
实施步骤二:启动docker镜像,安装latex
1、启动Ubuntu 1804的容器
jeffray@jeffray:~$ sudo docker run -it --rm ubuntu:18.04 bash
root@56a374364516:/# cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted
-i, --interactive Keep STDIN open even if not attached
-t, --tty Allocate a pseudo-TTY
--rm Automatically remove the container when it exits