-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
93 lines (76 loc) · 3.01 KB
/
Dockerfile
File metadata and controls
93 lines (76 loc) · 3.01 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
ARG BASE_IMAGE=ubuntu:22.04
FROM ${BASE_IMAGE}
WORKDIR /root
ARG GIT_EMAIL
# getting apt in a happy state
RUN apt autoremove --purge \
&& apt clean \
&& apt update -y
# export timezone and place timezone data /etc/timezone
ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Tree-sitter binary for nvim. Need to to this b/c its broken for ubuntu 22.04.
RUN apt install wget -y
RUN wget https://github.com/tree-sitter/tree-sitter/releases/download/v0.25.10/tree-sitter-linux-x64.gz
RUN gunzip tree-sitter-linux-x64.gz
RUN mv tree-sitter-linux-x64 tree-sitter
RUN chmod +x tree-sitter
RUN mv tree-sitter /usr/local/bin/
# Run a provisioning script
RUN apt install sudo # In case this is not available before the script is run.
COPY provision.sh provision.sh
RUN bash provision.sh
RUN rm provision.sh
# Check if pip is installed, if not install it.
RUN command -v pip || (apt install -y python3-pip)
RUN pip install \
black \
ipython \
magic-wormhole \
mypy \
pylint
# installing google chrome
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN DEBIAN_FRONTEND=noninteractive apt install ./google-chrome*.deb -y
RUN rm -rf ./google-chrome*.deb
# unminimize the docker
# RUN yes | unminimize || true
# git config
RUN git config --global user.name "Brandon Knape" \
&& git config --global user.email "$GIT_EMAIL" \
&& git config --global core.editor nvim \
&& git config --global diff.tool nvimdiff \
&& git config --global difftool.prompt false \
&& git config --global difftool.trustExitCode true \
&& git config --global merge.tool nvimdiff \
&& git config --global mergetool.prompt false \
&& git config --global mergetool.trustExitCode true \
&& git config --global --add safe.directory '*'
# doing whole bunch of dot file stuff.
RUN git clone https://github.com/dbrandonk/.dotfiles
RUN mv .dotfiles/.bashrc-extra .bashrc-extra
# Doing some hacky writing to the .bashrc
RUN echo '. $HOME/.bashrc-extra' >> .bashrc
# Hacky tmux stuff. Too lazy to fix rn.
RUN echo 'if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then' >> .bashrc \
&& echo 'exec tmux' >> .bashrc \
&& echo 'fi' >> .bashrc
# making the prompt pretty. ;)
RUN rm -rf ~/.bash-git-prompt # remove this if it exists for some reason.
RUN git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1
RUN echo 'source $HOME/.bash-git-prompt/gitprompt.sh' >> .bashrc
RUN apt-get install locales -y
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG=en_US.utf8
# tmux and vim config files
RUN mv .dotfiles/.tmux.conf .tmux.conf
RUN mv .dotfiles/.vimrc .vimrc
RUN rm .dotfiles -rf
# getting my ssh file from my host machine.
RUN rm .ssh -rf
ADD .ssh .ssh
# All the vim plugins.
RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
RUN vim -c ':PlugInstall' -c ':qall'
RUN mkdir -p .vim/tmp
CMD ["/bin/bash"]