-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.debian32
158 lines (129 loc) · 3.49 KB
/
Dockerfile.debian32
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
FROM i386/debian:testing
ARG USER=shank
ARG PASSWD=pass
ARG UID=1000
ARG GID=1000
ENV USER=${USER}
ENV HOME=/home/${USER}
# to fix tzdata hanging up the build process
ENV DEBIAN_FRONTEND=noninteractive
# better colors
ENV TERM=xterm-256color
# update, upgrade
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y
# locales
# source: https://serverfault.com/a/801162
ENV LANG=en_US.UTF-8
RUN apt-get install -y locales \
&& sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG=$LANG
# timezone
RUN apt-get install -yq tzdata \
&& mv /etc/localtime /etc/localtime.bak \
&& ln -s /usr/share/zoneinfo/America/Indianapolis /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata
ENV TZ="America/Indianapolis"
# apt-utils will be useful
RUN apt-get install -y apt-utils \
&& apt-get autoremove -y
# install sudo
RUN apt-get install -y sudo \
&& apt-get autoremove -y
# unminimize since this is a dev container
# RUN yes | unminimize
# dev packages
RUN apt-get install -y \
apt-file \
bat \
bfs \
clang \
clang-format \
cmake \
curl \
exa \
fd-find \
file \
fish \
fzf \
git \
htop \
less \
lld \
llvm \
make \
man-db \
neofetch \
plocate \
python-is-python3 \
python3 \
python3-pip \
python3-venv \
ripgrep \
stow \
tealdeer \
tmux \
unzip \
wget \
xclip \
xsel \
xz-utils \
&& apt-get autoremove -y
# bat -> batcat
RUN ln -s /usr/bin/batcat /usr/bin/bat
# fd -> fdfind
RUN ln -s /usr/bin/fdfind /usr/bin/fd
# rust
# # https://github.com/rust-lang/rustup/issues/297#issuecomment-444818896
# RUN /usr/bin/bash -c 'curl https://sh.rustup.rs -sSf | sh -s -- -y'
# RUN mkdir ~/.cargo-target
RUN apt-get install -y cargo rustc
# create user
RUN useradd --create-home ${USER} --uid ${UID} --shell /usr/bin/bash && \
echo "${USER}:${PASSWD}" | chpasswd && \
echo "${USER} ALL=(ALL) ALL" >> /etc/sudoers
RUN echo "${USER}:${PASSWD}" | chpasswd
RUN chown -R ${USER} /home/${USER}
# change users default shell
RUN chsh ${USER} --shell /usr/bin/fish
# change to $USER directory
WORKDIR /home/${USER}
USER ${USER}
# rust(2)
# RUN mkdir ~/.cargo-target
# cargo utils
RUN /usr/bin/bash --login -c 'cargo install stylua sd'
# dotfiles
RUN git clone https://gitlab.com/shank/dotfiles.git \
&& cd dotfiles \
&& git remote set-url origin [email protected]:shank/dotfiles.git
# stow packages
RUN cd dotfiles \
&& rm --force ${HOME}/.config/fish/functions/fish_user_key_bindings.fish \
&& stow --verbose --no-folding fish neovim tmux bins git
# tmux plugin manager
RUN git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
# fish prompt
USER root
RUN /home/${USER}/.cargo/bin/sd -s "'>'" "' |'" /usr/share/fish/functions/fish_prompt.fish
RUN /home/${USER}/.cargo/bin/sd -s "'#'" "' #'" /usr/share/fish/functions/fish_prompt.fish
USER ${USER}
# change the shell for the rest of the commands commands
SHELL ["/usr/bin/fish", "--login", "-c"]
# fisher (fish shell)
RUN curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
RUN fisher install patrickf1/fzf.fish
# npm stuff
RUN npm config set prefix $HOME/.npm-global
RUN npm install -g prettier neovim
# copy nix installation script
COPY scripts/setup/nix.sh .
COPY scripts/setup/nix_pkgs.sh .
USER root
RUN chown ${USER}:${USER} nix.sh nix_pkgs.sh
USER ${USER}
# after starting container, use nix for installing
# - neovim
# - lazygit
# start fish shell
# ENTRYPOINT ["fish"]