-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.env
More file actions
127 lines (109 loc) · 3.53 KB
/
Dockerfile.env
File metadata and controls
127 lines (109 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# LaTeX environment.
#
# Alessandro Tenaglia <alessandro.tenaglia42@gmail.com>
# Roberto Masocco <robmasocco@gmail.com>
#
# January 23, 2023
FROM ubuntu:22.04
ARG USER_UID=1000
ENV DEBIAN_FRONTEND=noninteractive
# Install basic utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
ca-certificates \
cpanminus \
curl \
git \
gnupg \
htop \
less \
nano \
openssh-client \
openssl \
procps \
python3 \
software-properties-common \
wget && \
add-apt-repository universe && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*/apt/lists/*
# Install language and locales
RUN apt-get update && apt-get install -y --no-install-recommends \
locales && \
locale-gen en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*/apt/lists/*
ENV LANG=en_US.UTF-8
# Install Zsh
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-pygments \
zsh \
zsh-doc && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*/apt/lists/*
# Install TeX Live and various TeX utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
biber \
build-essential \
cm-super \
ghostscript \
inkscape \
latexmk \
lmodern \
make \
pandoc \
tex-gyre \
texlive \
texlive-bibtex-extra \
texlive-extra-utils \
texlive-fonts-extra \
texlive-font-utils \
texlive-lang-english \
texlive-lang-italian \
texlive-latex-extra \
texlive-latex-recommended \
texlive-plain-generic \
texlive-science && \
rm -rf /var/lib/apt/lists/*
# Install latexindent dependencies (Perl modules)
RUN cpanm -n -q Log::Log4perl && \
cpanm -n -q XString && \
cpanm -n -q Log::Dispatch::File && \
cpanm -n -q YAML::Tiny && \
cpanm -n -q File::HomeDir && \
cpanm -n -q Unicode::GCString
# Cleanup
RUN apt-get autoremove -y && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*/apt/lists/*
# Create a non-root sudo user with Zsh as shell
RUN useradd -r -m -s /bin/bash -u ${USER_UID} latex
ENV HOME=/home/latex
RUN chsh -s /usr/bin/zsh latex
# Create workspace directory: host workspaces will be mounted here
RUN mkdir ${HOME}/workspace && \
chown latex:latex ${HOME}/workspace
# Create shell history file
RUN mkdir ${HOME}/zsh_history && \
chown latex:latex ${HOME}/zsh_history
# Create SSH directory for user
RUN mkdir ${HOME}/.ssh
# Switch to internal user
USER latex
WORKDIR ${HOME}
# Copy user configuration files
COPY --chown=latex:latex ./config/.aliases.sh ./
COPY --chown=latex:latex ./config/.bashrc ./
COPY --chown=latex:latex ./config/.nanorc ./
# Configure Zsh for internal user
ENV ZSH=${HOME}/.oh-my-zsh
ENV ZSH_CUSTOM=${ZSH}/custom
ENV ZSH_PLUGINS=${ZSH_CUSTOM}/plugins
ENV ZSH_THEMES=${ZSH_CUSTOM}/themes
RUN wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | zsh || true
RUN git clone --single-branch --branch 'master' --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_PLUGINS}/zsh-syntax-highlighting \
&& git clone --single-branch --branch 'master' --depth 1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_PLUGINS}/zsh-autosuggestions \
&& git clone --single-branch --depth 1 https://github.com/romkatv/powerlevel10k.git ${ZSH_THEMES}/powerlevel10k
COPY --chown=latex:latex ./config/.p10k.zsh ./
COPY --chown=latex:latex ./config/.zshrc ./
ENV DEBIAN_FRONTEND=dialog
# Start shell in container
CMD ["zsh"]