From eebad7cd9b2e1fbac9699d1ce4532977cc16d622 Mon Sep 17 00:00:00 2001 From: Luiz Gonzaga dos Santos Filho Date: Tue, 6 Jun 2017 17:00:06 +0200 Subject: [PATCH 1/4] [Install] Prevent empty SHELL failing installation When running yadr via docker, $SHELL starts out empty/null, so that was triggering a fatal method not found error during installation. --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 3c1d29d0..a5b2586f 100644 --- a/Rakefile +++ b/Rakefile @@ -274,7 +274,7 @@ def install_prezto run %{ mkdir -p $HOME/.zsh.after } run %{ mkdir -p $HOME/.zsh.prompts } - if ENV["SHELL"].include? 'zsh' then + if "#{ENV['SHELL']}".include? 'zsh' then puts "Zsh is already configured as your shell of choice. Restart your session to load the new settings" else puts "Setting zsh as your default shell" From 24c2879b5572a2ce28e2f621f2fbb86d41153bdc Mon Sep 17 00:00:00 2001 From: Luiz Gonzaga dos Santos Filho Date: Tue, 6 Jun 2017 16:50:23 +0200 Subject: [PATCH 2/4] [Docker] Add initial docker files --- .dockerignore | 4 ++++ Dockerfile | 54 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 8 +++++++ 3 files changed, 66 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..db7ffc5f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +docker-compose.yml +Dockerfile +bin/fix_macvim_external_display.sh +bin/osx diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..918165fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +FROM ubuntu:16.04 +LABEL maintainer="Luiz Filho " + +# Let the container know that there is no tty +ENV DEBIAN_FRONTEND noninteractive +ENV TERM xterm-256color + +# Bootstrapping packages needed for installation +RUN \ + apt-get update && \ + apt-get install -yqq \ + locales \ + lsb-release \ + software-properties-common && \ + apt-get clean + +# Set locale to UTF-8 +ENV LANGUAGE en_US.UTF-8 +ENV LANG en_US.UTF-8 +RUN localedef -i en_US -f UTF-8 en_US.UTF-8 && \ + /usr/sbin/update-locale LANG=$LANG + +# Install dependencies +# `universe` is needed for ruby +# `security` is needed for fontconfig and fc-cache +RUN \ + add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe security" && \ + add-apt-repository ppa:aacebedo/fasd && \ + apt-get update && \ + apt-get -yqq install \ + autoconf \ + build-essential \ + curl \ + fasd \ + fontconfig \ + git \ + python \ + python-setuptools \ + python-dev \ + ruby-full \ + sudo \ + tmux \ + vim \ + wget \ + zsh && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Install dotfiles +COPY . /root/.yadr +RUN cd /root/.yadr && rake install + +# Run a zsh session +CMD [ "/bin/zsh" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..7b9ba7d3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3" +services: + dotfiles: + build: + context: . + image: yadr + volumes: + - ./:/root/.yadr/ From ca407604f043104406e2fc83978dd0a7fd9ca757 Mon Sep 17 00:00:00 2001 From: Luiz Gonzaga dos Santos Filho Date: Tue, 6 Jun 2017 17:00:45 +0200 Subject: [PATCH 3/4] [Docker] Update README with Docker support --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a9c59f5f..2d8921cb 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,9 @@ * More than 90 vim plugins, all under one roof, working together, each plugin researched and configured to be at its best, often with better shortcut keys. * Many zsh plugins, starting with the wonderful Prezto base, and adding a few niceties on top. * All things are vimized: irb, postgres command line, etc. - + *Linux/Ubuntu is not supported! If it works, great. If it doesn't, please don't complain. You may need to install zsh if you don't already have it.* +*That being said, check the Docker section below* ## Mailing List @@ -281,6 +282,20 @@ of plugins above to learn more. * [Overriding vim settings with ~/.vimrc.after and friends](doc/vim/override.md) * [Adding your own vim plugins](doc/vim/manage_plugins.md) +## Testing with Docker + +We can use Docker to test some changes in a **Linux** Container. + +Assuming your host system has Docker & Docker Compose properly installed, run: + + docker-compose run dotfiles + +This will build the container image it never built it before (which may take a while -- future times will be faster) and then run a `zsh` session inside that container for you. +There you can play around, test commands, aliases, etc. + +*Warning*: this repo is primarly OSX oriented. So any support for Linux can only be done with the help of the community. + + ## Misc * [Credits & Thanks](doc/credits.md) @@ -316,11 +331,9 @@ brew uninstall vim rvm system do brew install vim --with-lua ``` - ### [Pry](http://pry.github.com/) Pry offers a much better out of the box IRB experience with colors, tab completion, and lots of other tricks. You can also use it as an actual debugger by installing [pry-nav](https://github.com/nixme/pry-nav). [Learn more about YADR's pry customizations and how to install](doc/pry.md) - From 628a97be6a7e474eb8db6b8f8ae1413794dc0eca Mon Sep 17 00:00:00 2001 From: Luiz Gonzaga dos Santos Filho Date: Tue, 20 Jun 2017 17:10:44 +0200 Subject: [PATCH 4/4] [Credits] Add docker support --- doc/credits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/credits.md b/doc/credits.md index 43e74a04..c6bfefe1 100644 --- a/doc/credits.md +++ b/doc/credits.md @@ -23,4 +23,4 @@ Yadr is made possible by many awesome people, too many to list :) But here are a * Cleanup, auto installer: @[kylewest](https://github.com/kylewest) * Switch from oh-my-zsh to Presto: @[JeanMertz](https://github.com/JeanMertz) * Vundle migration: @[duhanebel](https://github.com/duhanebel) - + * Docker support: @[lfilho](https://github.com/lfilho)