From 30b0a4fd70cd9241290939e2de6a8f29b8067217 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 24 Jun 2015 00:08:13 -0700 Subject: [PATCH] Add fedora 22 dev image --- dev/fedora/22/base/Dockerfile | 39 +++++++++++++++++++++++++ dev/fedora/22/base/setup.sh | 48 +++++++++++++++++++++++++++++++ dev/fedora/22/base/vimplugins.lua | 12 ++++++++ 3 files changed, 99 insertions(+) create mode 100644 dev/fedora/22/base/Dockerfile create mode 100755 dev/fedora/22/base/setup.sh create mode 100644 dev/fedora/22/base/vimplugins.lua diff --git a/dev/fedora/22/base/Dockerfile b/dev/fedora/22/base/Dockerfile new file mode 100644 index 0000000..9b8ac32 --- /dev/null +++ b/dev/fedora/22/base/Dockerfile @@ -0,0 +1,39 @@ +FROM fedora:22 + +RUN dnf -y groupinstall "Development Tools" &&\ + dnf -y install tar zsh git python wget openssl-devel vim-enhanced tmux dtach cmake python-devel mercurial lua luarocks gcc-c++ xz clang-devel &&\ + useradd --create-home xena && \ + echo 'root:screencast' | chpasswd && \ + echo 'xena:user' | chpasswd && \ + chsh xena -s /bin/zsh + +# Envvars! +ENV HOME /home/xena +ENV DOCKER YES +ENV LANGUAGE en_US +ENV LC_ALL en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LC_CTYPE en_US.UTF-8 + +# To use Docker please pass the docker socket as a bind mount +# Some of my servers still use docker 1.3.0 +RUN wget https://get.docker.com/builds/Linux/x86_64/docker-1.3.0 -O /usr/local/bin/docker && \ + chmod 555 /usr/local/bin/docker + +# Golang compilers +RUN cd /usr/local && wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz && \ + tar xf go1.4.2.linux-amd64.tar.gz && rm go1.4.2.linux-amd64.tar.gz + +ADD setup.sh /opt/xena/setup.sh +ADD ./vimplugins.lua /opt/xena/vimplugins.lua +RUN chmod 777 /opt/xena/setup.sh &&\ + su xena "/opt/xena/setup.sh" + +RUN dnf -y install dnf-plugins-core &&\ + yes | dnf copr enable xena/moonscript &&\ + dnf -y install lua-moonscript &&\ + yes | dnf copr enable avsej/nim &&\ + dnf -y install nim + +USER xena +CMD /bin/zsh diff --git a/dev/fedora/22/base/setup.sh b/dev/fedora/22/base/setup.sh new file mode 100755 index 0000000..6c7bea8 --- /dev/null +++ b/dev/fedora/22/base/setup.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -x + +# Sanity check / setup +cd /home/xena +mkdir code ||: + +# Clone dotiles +git clone https://github.com/Xe/dotfiles code/dotfiles ||: + +# setlink sets a symlink to my dotfiles repo for the correct file. +function setlink +{ + rm -rf $HOME/$1 + ln -s $HOME/code/dotfiles/$1 $HOME/$1 +} + +# set links +setlink .zshrc +setlink .zsh +setlink .vim +setlink .vimrc +setlink .gitconfig +setlink .tmux.conf + +export GOPATH=/home/xena/go +export PATH=/usr/local/go/bin:$PATH + +# Golang stuff +(mkdir -p ~/go/{pkg,bin,src}) +go get github.com/mattn/todo +go get github.com/motemen/ghq +go get github.com/Xe/tools/license + +# Setup vundle +git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + +# Set up vim plugins +cat ~/.vimrc | grep Plugin | cut -d"'" -f2 > ~/.plugins +(cd ~/.vim/bundle && lua /opt/xena/vimplugins.lua ~/.plugins) + +# Binary extensions for vim +(cd ~/.vim/bundle/YouCompleteMe; ./install.sh --clang-completer) +(cd ~/.vim/bundle/vimproc.vim; make) +vim -T dumb +GoInstallBinaries +qall + +echo "Set up!" diff --git a/dev/fedora/22/base/vimplugins.lua b/dev/fedora/22/base/vimplugins.lua new file mode 100644 index 0000000..ca8098b --- /dev/null +++ b/dev/fedora/22/base/vimplugins.lua @@ -0,0 +1,12 @@ +fin = io.open(arg[1], "r") + +if fin == nil then + error("Can't open " .. arg[1]) +end + +for line in fin:lines() do + os.execute("git clone https://github.com/" .. line) + os.execute("cd " .. line:match(".+/(.+)") .. " && git submodule update --init --recursive && cd ..") +end + +fin:close()