-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile
52 lines (45 loc) · 2.38 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
FROM golang:latest
MAINTAINER Michele Bertasi
ADD fs/ /
# install pagkages
RUN apt-get update && \
apt-get install -y ncurses-dev libtolua-dev exuberant-ctags gdb && \
ln -s /usr/include/lua5.2/ /usr/include/lua && \
ln -s /usr/lib/x86_64-linux-gnu/liblua5.2.so /usr/lib/liblua.so && \
# cleanup
apt-get clean && rm -rf /var/lib/apt/lists/*
# build and install vim
RUN cd /tmp && \
git clone --depth 1 https://github.com/vim/vim.git && \
cd vim && \
./configure --with-features=huge --enable-luainterp \
--enable-gui=no --without-x --prefix=/usr && \
make VIMRUNTIMEDIR=/usr/share/vim/vim82 && \
make install && \
# cleanup
rm -rf /tmp/* /var/tmp/*
# get go tools
RUN go get golang.org/x/tools/cmd/godoc && \
go get github.com/nsf/gocode && \
go get golang.org/x/tools/cmd/goimports && \
go get github.com/rogpeppe/godef && \
go get golang.org/x/tools/cmd/gorename && \
go get golang.org/x/lint/golint && \
go get github.com/kisielk/errcheck && \
go get github.com/jstemmer/gotags && \
go get github.com/tools/godep && \
go get github.com/go-delve/delve/cmd/dlv && \
GO111MODULE=on go get golang.org/x/tools/gopls@latest && \
mv /go/bin/* /usr/local/go/bin && \
# cleanup
rm -rf /go/src/* /go/pkg
# add dev user
RUN adduser dev --disabled-password --gecos "" && \
echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers && \
chown -R dev:dev /home/dev /go
USER dev
ENV HOME /home/dev
# install vim plugins
RUN curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim && \
vim +PlugInstall +qall