forked from skwp/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
88 lines (74 loc) · 2.1 KB
/
Dockerfile
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
# syntax=docker/dockerfile:1
FROM ubuntu:20.04
LABEL maintainer="Nanda Lopes <[email protected]>"
ENV TERM=xterm-256color
VOLUME /root/.yadr/root/vim/plugged
VOLUME /root/.zprezto
# Let the container know that there is no tty
ARG DEBIAN_FRONTEND=noninteractive
# Bootstrapping packages needed for installation
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& apt-get install -qqy \
locales \
lsb-release \
software-properties-common \
&& apt-get clean
# Set locale to UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN localedef -i en_US -f UTF-8 en_US.UTF-8 && \
/usr/sbin/update-locale LANG=$LANG
# Install dependencies
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& apt-get install -qqy \
curl \
git \
sudo \
wget \
&& apt-get clean
# Install YADR dependencies
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& apt-get install -qqy \
fontconfig \
ruby-full \
tmux \
vim \
zsh \
&& apt-get clean
# Install optional dependencies
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& apt-get install -qqy \
build-essential \
direnv \
myrepos \
ripgrep \
silversearcher-ag \
universal-ctags \
&& apt-get clean
# disable docker-clean
RUN mv /etc/apt/apt.conf.d/docker-clean /etc/apt/apt.conf.d/docker-clean.disabled
# Install dotfiles
COPY . /root/.yadr
WORKDIR /root/.yadr
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=cache,id=cache-yadr,target=/root/.cache/chezmoi \
./install.sh
# Install vim plugins
# RUN vim -es -u ~/.vimrc -i NONE -c 'PlugClean!' -c 'PlugInstall! --sync' -c 'qall'
SHELL [ "/bin/zsh", "--command" ]
# Run a zsh session
CMD [ "/bin/zsh" ]