diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Dockerfile | 73 | ||||
-rw-r--r-- | Dockerfile.javascript | 15 | ||||
-rw-r--r-- | Dockerfile.php | 25 | ||||
-rw-r--r-- | Dockerfile.python | 46 | ||||
-rw-r--r-- | Dockerfile.shell | 16 | ||||
-rw-r--r-- | Makefile | 27 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | shellcheck-builder/Dockerfile | 27 |
9 files changed, 119 insertions, 120 deletions
@@ -1 +1,2 @@ +package .vimcache diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cdcf41d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,73 @@ +FROM alpine:3.3 + +# Add the testing repo to get neovim +RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories + +# Install all the needed packages +RUN apk add --no-cache \ + # My Stuff + php \ + php-json \ + php-phar \ + php-openssl \ + curl \ + git \ + ack \ + python-dev \ + python3-dev \ + nodejs \ + neovim@testing \ + # Needed for python pip installs + musl-dev \ + gcc + +# Configure Git +RUN git config --global user.email "codyfh@gmail.com" +RUN git config --global user.name "Cody Hiar" + +# Install pip for both versions of python +RUN python -m ensurepip +RUN python3 -m ensurepip + +# Download composer and move it to new location +RUN curl -sS https://getcomposer.org/installer | php +RUN mv composer.phar /usr/local/bin/composer + +# Update the path to include composer bins +ENV PATH "$PATH:/root/.composer/vendor/bin" + +# Composer install Code Sniff +RUN composer global require "squizlabs/php_codesniffer=*" + +# Install Symfony 2 coding standard +RUN composer global require --dev escapestudios/symfony2-coding-standard:~2.0 + +# Add Symfony 2 coding standard to the phpcs paths +RUN phpcs --config-set installed_paths /root/.composer/vendor/escapestudios/symfony2-coding-standard + +# Install custom linting +ADD PEARish.xml /root/PEARish.xml + +# Install python linting and neovim plugin +RUN pip install neovim flake8 flake8-docstrings flake8-import-order flake8-quotes pep8 pep8-naming pep257 +RUN pip3 install neovim + +# Install nodejs linting +# Install JS linting modules +# The reason for the version specifications is an 'Unmet peerDependancy error' +# https://github.com/airbnb/javascript/issues/952 +# Commented out because I can't make it work right now +# RUN npm install -g eslint@\^2.10.2 eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y@\^1.2.2 + +# Install the eslintrc.json +ADD eslintrc.json /root/.eslintrc.json + +# Copy over the shellcheck binaries +COPY package/bin/shellcheck /usr/local/bin/ +COPY package/lib/ /usr/local/lib/ +RUN ldconfig /usr/local/lib + + + +ENTRYPOINT ["sh"] + diff --git a/Dockerfile.javascript b/Dockerfile.javascript deleted file mode 100644 index 592f58a..0000000 --- a/Dockerfile.javascript +++ /dev/null @@ -1,15 +0,0 @@ -FROM thornycrackers/neovim:php -MAINTAINER Cody Hiar <codyfh@gmail.com> - -# Install nodejs 6 -RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - -RUN apt-get install -y \ - nodejs - -# Install JS linting modules -# The reason for the version specifications is an 'Unmet peerDependancy error' -# https://github.com/airbnb/javascript/issues/952 -RUN npm install -g eslint@\^2.10.2 eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y@\^1.2.2 - -# Install the eslintrc.json -ADD eslintrc.json /root/.eslintrc.json diff --git a/Dockerfile.php b/Dockerfile.php deleted file mode 100644 index 7c05dfc..0000000 --- a/Dockerfile.php +++ /dev/null @@ -1,25 +0,0 @@ -FROM thornycrackers/neovim:python -MAINTAINER Cody Hiar <codyfh@gmail.com> - -# Install packages -RUN apt-get update && apt-get install -y \ - curl \ - php5 - -# Download composer and move it to new location -RUN curl -sS https://getcomposer.org/installer | php -RUN mv composer.phar /usr/local/bin/composer - -# Update the path to include composer bins -ENV PATH "$PATH:/root/.composer/vendor/bin" - -# Composer install Code Sniff -RUN composer global require "squizlabs/php_codesniffer=*" -# Install Symfony 2 coding standard -RUN composer global require --dev escapestudios/symfony2-coding-standard:~2.0 - -# Add Symfony 2 coding standard to the phpcs paths -RUN phpcs --config-set installed_paths /root/.composer/vendor/escapestudios/symfony2-coding-standard - -# Install custom linting -ADD PEARish.xml /root/PEARish.xml diff --git a/Dockerfile.python b/Dockerfile.python deleted file mode 100644 index bca59f3..0000000 --- a/Dockerfile.python +++ /dev/null @@ -1,46 +0,0 @@ -FROM ubuntu:14.04 -MAINTAINER Cody Hiar <codyfh@gmail.com> - -# Set the working directory -WORKDIR /src - -# Fix upstart errors -RUN dpkg-divert --local --rename --add /sbin/initctl -RUN ln -sf /bin/true /sbin/initctl - -# This prevents a bunch of errors during build -ENV DEBIAN_FRONTEND noninteractive - -# Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start. -RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d - - -# Install packages -RUN apt-get update && apt-get install -y \ - software-properties-common \ - git \ - ack-grep \ - python-dev \ - python-pip \ - python3-dev \ - python3-pip - -# Set git stuff -RUN git config --global user.email "codyfh@gmail.com" -RUN git config --global user.name "Cody Hiar" - -# Install Neovim -RUN add-apt-repository ppa:neovim-ppa/unstable -y -RUN apt-get update && apt-get install -y \ - neovim - -# Install the neovim python plugins -RUN pip install neovim flake8 flake8-docstrings flake8-import-order flake8-quotes pep8 pep8-naming pep257 -RUN pip3 install neovim - -# Download my Neovim Repo -RUN git clone https://github.com/thornycrackers/.nvim.git /root/.config/nvim - -# Install neovim Modules -RUN nvim +PlugInstall +qa -RUN nvim +UpdateRemotePlugins +qa diff --git a/Dockerfile.shell b/Dockerfile.shell deleted file mode 100644 index 3e34605..0000000 --- a/Dockerfile.shell +++ /dev/null @@ -1,16 +0,0 @@ -FROM thornycrackers/neovim:javascript -MAINTAINER Cody Hiar <codyfh@gmail.com> - -# Install packages -RUN apt-get update && apt-get install -y \ - cabal-install - -# Install Shellcheck -RUN cabal update -RUN cabal install shellcheck - -# Include the cabal bins -ENV PATH "$PATH:/root/.cabal/bin" - - - @@ -1,21 +1,18 @@ help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' +build: ## Build the image + clear + make build-shellcheck + docker build -t thornycrackers/alpine . -build-python: ## Build the neovim python image, this is the base image - docker build -f Dockerfile.python -t thornycrackers/neovim:python . +build-shellcheck: ## build the shellcheck binaries + clear + docker build -t thornycrackers/shellcheck shellcheck-builder + docker run --rm -it -v $(CURDIR):/mnt thornycrackers/shellcheck -build-php: ## Build the neovim php image, depends on python tag - docker build -f Dockerfile.php -t thornycrackers/neovim:php . +enter: ## Enter the image + docker run -i -t thornycrackers/alpine -build-javascript: ## Build the neovim javascript image, depends on php tag - docker build -f Dockerfile.javascript -t thornycrackers/neovim:javascript . - -build-shell: ## Build the neovim shell image, depends on javascript tag - docker build -f Dockerfile.shell -t thornycrackers/neovim . - -build: ## Build all the whole thing - make build-python - make build-php - make build-javascript - make build-shell +clearn: ## Remove the shellcheck binaries + rm -rf package @@ -1,10 +1,13 @@ # Dockerized Neovim Run neovim in a container and be cool like all the other cool kids. -I like to dockerize all my tools so I am making this repo to dockerize Neovim. +I'm currently trying to have as little dependancies installed on my host machine as possible. # Step 1: Build the image -The first step is to build the the docker image. -I call mine thornycrackers/neovim so you will have to change that accordingly for the following steps +The are 2 small steps that occur in this step. +First we build the binaries for shellcheck, because I want to only have couple of MB's in binaries vs installing haskell. +This creates a folder called 'package' at the root directory which we then import to our main neovim image. +The second step is actually compiling the the neovim package which is just installing some stuff and copying the binaries. +This can all be done with a single make command. ``` $ make build ``` diff --git a/shellcheck-builder/Dockerfile b/shellcheck-builder/Dockerfile new file mode 100644 index 0000000..5cb4a63 --- /dev/null +++ b/shellcheck-builder/Dockerfile @@ -0,0 +1,27 @@ +FROM mitchty/alpine-ghc:latest + +MAINTAINER Nikyle Nguyen <NLKNguyen@MSN.com> + +RUN apk add --no-cache build-base git + + +RUN mkdir -p /usr/src/shellcheck +WORKDIR /usr/src/shellcheck + +RUN git clone https://github.com/koalaman/shellcheck . +RUN cabal update && cabal install + +ENV PATH="/root/.cabal/bin:$PATH" + + +# Get shellcheck binary +RUN mkdir -p /package/bin/ +RUN cp $(which shellcheck) /package/bin/ + +# Get shared libraries +RUN mkdir -p /package/lib/ +RUN ldd $(which shellcheck) | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /package/lib/ + + +# Copy shellcheck package out to mounted directory +CMD ["cp", "-avr", "/package", "/mnt/"] |