Created
June 2, 2018 07:08
-
-
Save jdevoo/a825d1eac56bcbe1a9468f5b58588e48 to your computer and use it in GitHub Desktop.
govim with exercism
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:latest | |
ARG EXERCISM_API_KEY | |
ADD templates/ / | |
# build and install vim | |
RUN apt-get update && apt-get install -y ncurses-dev ctags && cd /tmp && git clone https://github.com/vim/vim.git && cd vim && ./configure --with-features=huge --enable-gui=no --without-x --prefix=/usr && make VIMRUNTIMEDIR=/usr/share/vim/vim80 && make install | |
# install 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 github.com/golang/lint/ && go get github.com/kisielk/errcheck && go get github.com/jstemmer/gotags && go get github.com/tools/godep && mv /go/bin/* /usr/local/go/bin | |
# exercism | |
RUN cd /tmp && curl -OL https://github.com/exercism/cli/releases/download/v2.4.1/exercism-linux-64bit.tgz && tar xzf exercism-linux-64bit.tgz && mv exercism /usr/local/bin | |
# clean up | |
RUN rm -rf /go/src/* /go/pkg && apt-get remove -y ncurses-dev && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# add dev user | |
RUN groupadd -g 1000 dev && useradd -u 1000 -g dev dev && cp -rT /etc/skel /home/dev && chown -R dev:dev /home/dev /go | |
USER dev | |
ENV HOME /home/dev | |
# configure exercism and install vim plugins | |
RUN exercism configure --key=$EXERCISM_API_KEY --dir /home/dev/shared/exercism && curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim && vim +PlugInstall +qall | |
WORKDIR /home/dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment