-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
152 lines (141 loc) · 8.48 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
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
FROM python:3.8.3-buster
ENV DEBIAN_URL "http://ftp.us.debian.org/debian"
ENV UHOME /home/spacevim
ENV UNAME="spacevim"
ENV DEBIAN_FRONTEND=noninteractive
ENV GOROOT="/usr/lib/go"
ENV GOBIN="$GOROOT/bin"
ENV GOPATH="$UHOME/src"
ENV PATH="$PATH:$GOBIN:$GOROOT:$GOPATH/bin"
ENV TZ=Europe/Minsk
#ENV PATH=~/.npm-global/bin:$PATH
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& rm -rf /var/lib/apt/list && apt-get clean all && apt-get update -o Acquire::CompressionTypes::Order::=gz --fix-missing \
&& apt-get install --no-install-recommends -y autoconf automake cmake fish g++ gettext git libtool libtool-bin \
lua5.3 ninja-build pkg-config unzip xclip xfonts-utils exuberant-ctags \
wamerican wbritish tidy xclip latexmk xsel cscope \
libpython3-dev \
sudo zlib1g wget curl \
&& apt-get clean all \
&& groupdel users && groupadd -r -g 1000 spacevim \
&& useradd --create-home --home-dir $UHOME -u 1000 -r -g spacevim spacevim \
&& usermod -aG sudo spacevim \
&& usermod -aG root spacevim \
# No password sudo
&& touch "/etc/sudoers.d/${UNAME}" \
&& echo "${UNAME} ALL=(ALL) NOPASSWD: ALL" > "/etc/sudoers.d/${UNAME}" \
&& chmod 0440 "/etc/sudoers.d/${UNAME}"
# Install PHP
USER spacevim
WORKDIR /tmp
RUN echo "Going for Dependencies"
RUN wget https://github.com/git-time-metric/gtm/releases/download/v1.3.5/gtm.v1.3.5.linux.tar.gz && tar -xvzf gtm.v1.3.5.linux.tar.gz && sudo mv gtm /usr/local/bin && rm gtm.v1.3.5.linux.tar.gz \
&& git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install && sudo cp ~/.fzf/bin/fzf /usr/local/bin/ \
&& cd ~/ && git clone https://github.com/neovim/neovim.git && cd neovim && git checkout e786583 \
&& make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr/local" \
&& sudo make install && rm -r ~/neovim \
&& cd ~/ && wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz \
&& tar -xvf go1.14.4.linux-amd64.tar.gz \
&& sudo mv go /usr/lib \
&& cd /usr/lib/go && ls -lah \
&& sudo ln -snf /usr/lib/go/bin/go /usr/bin/go \
&& sudo mkdir -p $GOBIN && sudo chmod 770 $GOBIN \
&& sudo mkdir -p $GOROOT && sudo chmod 770 $GOROOT \
# Go requirements
&& go get -v -u -d github.com/klauspost/asmfmt/cmd/asmfmt \
&& go build -o $GOBIN/asmfmt github.com/klauspost/asmfmt/cmd/asmfmt \
&& go get -v -u -d github.com/go-delve/delve/cmd/dlv \
&& go build -o $GOBIN/dlv github.com/go-delve/delve/cmd/dlv \
&& go get -v -u -d github.com/kisielk/errcheck \
&& go build -o $GOBIN/errcheck github.com/kisielk/errcheck \
&& go get -v -u -d github.com/davidrjenni/reftools/cmd/fillstruct \
&& go build -o $GOBIN/fillstruct github.com/davidrjenni/reftools/cmd/fillstruct \
&& go get -v -u -d github.com/rogpeppe/godef \
&& go build -o $GOBIN/godef github.com/rogpeppe/godef \
&& go get -v -u -d github.com/zmb3/gogetdoc \
&& go build -o $GOBIN/gogetdoc github.com/zmb3/gogetdoc \
&& go get -v -u -d golang.org/x/tools/cmd/goimports \
&& go build -o $GOBIN/goimports golang.org/x/tools/cmd/goimports \
&& go get -v -u -d golang.org/x/lint/golint \
&& go build -o $GOBIN/golint golang.org/x/lint/golint \
&& go get -v -u -d golang.org/x/tools/gopls \
&& go build -o $GOBIN/gopls golang.org/x/tools/gopls \
&& go get -v -u -d github.com/alecthomas/gometalinter \
&& go build -o $GOBIN/gometalinter github.com/alecthomas/gometalinter \
&& go get -v -u -d github.com/fatih/gomodifytags \
&& go build -o $GOBIN/gomodifytags github.com/fatih/gomodifytags \
&& go get -v -u -d golang.org/x/tools/cmd/gorename \
&& go build -o $GOBIN/gorename golang.org/x/tools/cmd/gorename \
&& go get -v -u -d github.com/jstemmer/gotags \
&& go build -o $GOBIN/gotags github.com/jstemmer/gotags \
&& go get -v -u -d golang.org/x/tools/cmd/guru \
&& go build -o $GOBIN/guru golang.org/x/tools/cmd/guru \
&& go get -v -u -d github.com/josharian/impl \
&& go build -o $GOBIN/impl github.com/josharian/impl \
&& go get -v -u -d honnef.co/go/tools/cmd/keyify \
&& go build -o $GOBIN/keyify honnef.co/go/tools/cmd/keyify \
&& go get -v -u -d github.com/fatih/motion \
&& go build -o $GOBIN/motion github.com/fatih/motion \
&& go get -v -u -d github.com/koron/iferr \
&& go build -o $GOBIN/iferr github.com/koron/iferr \
&& go get -v -u -d github.com/stamblerre/gocode \
&& go build -o $GOBIN/gocode github.com/stamblerre/gocode \
&& cp $GOBIN/gocode $GOBIN/gocode-gomod \
&& go get -v -u -d github.com/sourcegraph/go-langserver \
&& go build -o $GOBIN/go-langserver github.com/sourcegraph/go-langserver \
&& curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.18.0 \
# PHP
#&& sudo apt-get install -y --no-install-recommends php php-json php-mbstring php-common php-xml php-tokenizer php-curl php-xml php-msgpack php-pear \
&& sudo apt-get install -y php php-json php-mbstring php-common php-xml php-tokenizer php-curl php-xml php-msgpack php-pear \
&& php -r "copy('https://getcomposer.org/download/1.8.4/composer.phar', 'composer.phar');" \
&& php -r "if (hash_file('sha256', 'composer.phar') === '1722826c8fbeaf2d6cdd31c9c9af38694d6383a0f2bf476fe6bbd30939de058a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer.phar'); } echo PHP_EOL;" \
&& chmod +x composer.phar \
&& sudo mv composer.phar /usr/local/bin/composer \
&& composer global require squizlabs/php_codesniffer \
&& composer global require phpmd/phpmd \
&& composer global require vimeo/psalm \
&& sudo pear channel-update pear.php.net \
&& sudo pear install --alldeps PHP_Beautifier-beta \
# Install Node
&& sudo apt-get install --no-install-recommends -y nodejs npm \
# Install Node Related
&& sudo npm cache clean -f \
&& chown $UNAME:$UNAME -R $UHOME \
&& sudo chown $UNAME:$UNAME -R /usr/local/lib \
&& sudo npm i -g npm@latest \
&& sudo chown $UNAME:$UNAME -R $UHOME \
# && mkdir ~/.npm-global && npm config set prefix '~/.npm-global' \
&& sudo npm install --unsafe-perm -g [email protected] \
&& sudo npm -g install --unsafe-perm typescript tslint eslint prettier javascript-typescript-langserver vscode-css-languageserver-bin bash-language-server purescript-language-server import-js eslint-plugin-prettier vscode-html-languageserver-bin eslint_d typescript-formatter tern \
&& sudo npm install -g neovim \
&& sudo npm cache clean --force \
# PIP more
#RUN pip install --user python-language-server neovim pipenv pyaml ujson sexpdata websocket-client
&& sudo apt-get install --no-install-recommends python3-pip python-pip -y \
&& sudo pip install --upgrade pip && sudo pip3 install --upgrade pip \
&& sudo pip --no-cache-dir install python-language-server neovim pipenv pyaml ujson sexpdata websocket-client \
&& sudo pip3 --no-cache-dir install python-language-server neovim pipenv pyaml ujson sexpdata websocket-client neovim-remote flake8 yapf autoflake isort coverage
ENV PATH "$UHOME/.local/bin:${PATH}"
ENV GOPATH="$GOPATH:$UHOME/src/src:$UHOME/src/src/vendor"
ENV PATH="$UHOME/.composer/vendor/bin:${PATH}"
COPY init.toml $UHOME/
RUN mkdir -p $UHOME/.config $UHOME/.SpaceVim.d $UHOME/notebook \
&& git clone --branch 2.0 https://github.com/Shougo/dein.vim.git $HOME/.cache/vimfiles/repos/github.com/Shougo/dein.vim \
&& git clone https://github.com/SpaceVim/SpaceVim.git $UHOME/.SpaceVim && cd $UHOME/.SpaceVim \
&& mv $UHOME/init.toml $UHOME/.SpaceVim.d/init.toml \
#&& git checkout tags/v1.2.0
&& curl -sLf https://spacevim.org/install.sh | bash \
&& mkdir -p $UHOME/.SpaceVim.d/autoload/ && mkdir -p $UHOME/.cache/SpaceVim/cscope/ \
&& sudo chown -R spacevim:spacevim ~/.SpaceVim.d/ \
&& nvim --headless +'call dein#install()' +qall \
&& sudo chown $UNAME:$UNAME -R /usr/lib/go/ \
&& cd ~/ && find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} + \
&& sudo apt-get clean all -y && sudo rm -rf /tmp/*
#&& composer clearcache
COPY myspacevim.vim $UHOME/.SpaceVim.d/autoload/
COPY ["Sauce Code Pro Nerd Font Complete Mono Windows Compatible.ttf","/usr/local/share/fonts/"]
COPY ["Sauce Code Pro Nerd Font Complete Mono Windows Compatible.ttf","$UNAME/.local/share/fonts"]
COPY run $UHOME/
RUN touch ~/.viminfo
RUN chmod o+w ~/.viminfo
ENTRYPOINT ["sh", "/home/spacevim/run"]