-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.dev
93 lines (74 loc) · 2.62 KB
/
Dockerfile.dev
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
FROM ubuntu:18.04
LABEL maintainer="Oliver Wissett"
LABEL version="1.0"
LABEL description="FreeSASA dev container including Rust"
ARG USERNAME=sasa
ARG USER_UID=1000
ARG USER_GID=${USER_UID}
ARG DEBIAN_FRONTEND=noninteractive
# Install core packages
RUN apt-get update && apt-get install -y \
git \
make \
pkg-config \
build-essential \
autoconf \
libc++-dev \
libc++abi-dev \
libjson-c-dev \
libxml2-dev \
libxml2-utils \
check \
zsh \
curl \
vim \
nano \
sudo \
wget \
libclang-dev \
clang \
linux-tools-generic \
python3-pip \
gnuplot
# Install rust tool chain
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Install oh-my-zsh on root
RUN bash -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
RUN mv /root/.oh-my-zsh /usr/share/oh-my-zsh
WORKDIR /usr/share/oh-my-zsh
RUN cp ./templates/zshrc.zsh-template zshrc
# Patch the zshrc file
RUN sed -i 's/plugins=(git)/plugins=(git zsh-syntax-highlighting)/g' ./zshrc \
&& wget https://aur.archlinux.org/cgit/aur.git/plain/0001-zshrc.patch\?h\=oh-my-zsh-git -O zshrc.patch && patch -p1 < zshrc.patch
RUN echo 'source $HOME/.cargo/env' >> ./zshrc
RUN echo 'alias perf=/usr/lib/linux-tools/4.15.0-201-generic/perf' >> ./zshrc
RUN cp ./zshrc /root/.zshrc
RUN sudo ln /usr/share/oh-my-zsh/zshrc /etc/skel/.zshrc
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& chown -R $USERNAME:$USERNAME /home/$USERNAME \
&& chsh -s $(which zsh) ${USERNAME}
# Install syntax highlighting
WORKDIR /home/sasa
# Install rust tool chain
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
RUN sed -i 's/plugins=(git)/plugins=(git zsh-syntax-highlighting)/g' ~/.zshrc
RUN git clone https://github.com/mittinatten/freesasa.git
WORKDIR /home/${USERNAME}/freesasa
RUN git submodule init
RUN git submodule update
RUN autoreconf -i
RUN ./configure CFLAGS="-Ofast" --disable-json --disable-xml
RUN make
RUN make install
ARG DEBIAN_FRONTEND=dialog
USER ${USERNAME}
# Install rust tool chain
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Install pre-commit
RUN pip3 install pre-commit
RUN echo 'export PATH=/home/sasa/.local/bin:$PATH' >> $HOME/.zshrc