From 7efa195c4ade7fbbab0977952724b70c32875dc8 Mon Sep 17 00:00:00 2001 From: eoli3n Date: Wed, 27 Dec 2017 13:16:29 +0100 Subject: [PATCH] no git clone in dockerfile --- .travis.yml | 15 ++++++--------- README.md | 4 ++-- TODO | 7 +++++-- docker/archlinux/Dockerfile | 6 +++--- docker/archlinux/README.md | 23 +++++++++++------------ docker/archlinux/test.sh | 2 +- docker/centos/Dockerfile | 6 +++--- docker/centos/README.md | 26 +++++++++----------------- docker/centos/test.sh | 2 +- docker/debian/Dockerfile | 7 ++++--- docker/debian/README.md | 22 +++++++++------------- docker/debian/test.sh | 2 +- vagrant/archlinux/Vagrantfile | 2 -- 13 files changed, 55 insertions(+), 69 deletions(-) diff --git a/.travis.yml b/.travis.yml index da64bce..e1965e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,11 @@ branches: - dev install: - - cd docker/archlinux - - docker build -t archlinux/dotfiles . - - cd ../debian - - docker build -t debian/dotfiles . - - cd ../centos - - docker build -t centos/dotfiles . + - docker build -t archlinux/dotfiles -f docker/archlinux/Dockerfile . + - docker build -t debian/dotfiles -f docker/debian/Dockerfile . + - docker build -t centos/dotfiles -f docker/centos/Dockerfile . script: - - docker run archlinux/dotfiles test.sh - - docker run debian/dotfiles test.sh - - docker run centos/dotfiles test.sh + - docker run archlinux/dotfiles dotfiles/docker/archlinux/test.sh + - docker run debian/dotfiles dotfiles/docker/debian/test.sh + - docker run centos/dotfiles dotfiles/docker/centos/test.sh diff --git a/README.md b/README.md index a040fe9..24af158 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Ansible allows to duplicate this Desktop Environment over multiple hosts with specific configuration (dualscreen, packages...). Fork Me! Please look at ``roles/*/README.md`` if exists for specific hosts configuration. -## Test VMs -Please check ``vagrant/*/README.md`` +## Test VMs|Containers +Please check ``vagrant/*/README.md`` and ``docker/*/README.md`` ## Desktop/Laptop Environment diff --git a/TODO b/TODO index a28ceca..9587fc5 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,9 @@ - TOTEST: ansible provisionner vagrant : https://github.com/hashicorp/vagrant/issues/7890 - TODO: change includes in import tasks to be able to resolv with list-tasks - TOFIX: chsh in vagrant config file for FreeBSD -- TOTEST : powerlines +- TOTEST: powerlines +- TOTEST: vagrant centos locales fr ? +- TOTEST: configure root account ? - TODO: check best install method all distrib powerline - TODO: clean zshrc - TODO: Ubuntu compat and vagrant for server tag @@ -13,7 +15,8 @@ to compile only dotfiles in an example dir ~/tmp ? what about lineinfile module ? - TODO: Add {{ tag }} to fail module to limit to distrib - TOFIX: get current branch to checkout in Dockerfile var -- TODO: docker compose pour build toutes les distros ? + https://superuser.com/questions/701735/run-script-on-host-machine-during-vagrant-up + git symbolic-ref --short -q HEAD - TODO: update all vagrant specific task to match docker tasks - TODO: install virtual display xephyr - TODO: docker autobuild to docker run directly, edit README.md diff --git a/docker/archlinux/Dockerfile b/docker/archlinux/Dockerfile index 6a211d0..f78f650 100644 --- a/docker/archlinux/Dockerfile +++ b/docker/archlinux/Dockerfile @@ -42,8 +42,8 @@ WORKDIR /home/test/ ENV LANG="fr_FR.UTF-8" RUN cd /tmp; curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer-git RUN cd /tmp; makepkg PKGBUILD --install --needed --noconfirm -RUN git clone --recursive https://github.com/eoli3n/dotfiles -RUN cd /home/test/dotfiles; ./install.sh desktop | tee ansible.log +RUN mkdir dotfiles +COPY . dotfiles/ +RUN cd dotfiles; ./install.sh desktop | tee ansible.log RUN echo -e "test" | chsh -s '/usr/bin/zsh' -ADD test.sh . ENTRYPOINT /usr/bin/zsh diff --git a/docker/archlinux/README.md b/docker/archlinux/README.md index 6663efc..b23636f 100644 --- a/docker/archlinux/README.md +++ b/docker/archlinux/README.md @@ -1,16 +1,15 @@ -## Store Docker files in /home +## Build and run Locally ``` -sudo cp -R /var/lib/docker /home/ -sudo rm -Rf /var/lib/docker -sudo ln -s /home/docker /var/lib/docker +git clone https://github.com/eoli3n/dotfiles +cd dotfiles +git checkout +sudo docker build -t archlinux/dotfiles -f docker/archlinux/Dockerfile . +sudo docker run -t archlinux/dotfiles ``` -## Clean Docker files -``` -sudo docker system prune -``` +## User +Login : ``test`` +Password : ``test`` -## Start Docker -``` -sudo docker build -t archlinux-dotfiles . -``` +## Use automated online builds +Soon diff --git a/docker/archlinux/test.sh b/docker/archlinux/test.sh index 8025803..c3785af 100755 --- a/docker/archlinux/test.sh +++ b/docker/archlinux/test.sh @@ -1,2 +1,2 @@ #!/bin/bash -grep 'failed=0' ~/ansible.log +grep 'failed=0' ~/dotfiles/ansible.log diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile index ebd810d..190b5e2 100644 --- a/docker/centos/Dockerfile +++ b/docker/centos/Dockerfile @@ -31,8 +31,8 @@ RUN echo "test ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers USER test WORKDIR /home/test/ ENV LANG="fr_FR.UTF-8" -RUN git clone --recursive https://github.com/eoli3n/dotfiles -RUN cd /home/test/dotfiles; ./install.sh server | tee ansible.log +RUN mkdir dotfiles +COPY . dotfiles/ +RUN cd dotfiles; ./install.sh server | tee ansible.log RUN echo -e "dockerpass" | chsh -s /bin/zsh -ADD test.sh . ENTRYPOINT /usr/bin/zsh diff --git a/docker/centos/README.md b/docker/centos/README.md index 05462ae..21c9261 100644 --- a/docker/centos/README.md +++ b/docker/centos/README.md @@ -1,20 +1,12 @@ +## Build and run Locally +``` +git clone https://github.com/eoli3n/dotfiles +cd dotfiles +git checkout +sudo docker build -t centos/dotfiles -f docker/centos/Dockerfile . +sudo docker run -t centos/dotfiles +``` + ## User Login : ``test`` Password : ``dockerpass`` - -## Store Docker files in /home -``` -sudo cp -R /var/lib/docker /home/ -sudo rm -Rf /var/lib/docker -sudo ln -s /home/docker /var/lib/docker -``` - -## Clean Docker files -``` -sudo docker system prune -``` - -## Start Docker -``` -sudo docker build -t archlinux-dotfiles . -``` diff --git a/docker/centos/test.sh b/docker/centos/test.sh index 8025803..c3785af 100755 --- a/docker/centos/test.sh +++ b/docker/centos/test.sh @@ -1,2 +1,2 @@ #!/bin/bash -grep 'failed=0' ~/ansible.log +grep 'failed=0' ~/dotfiles/ansible.log diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 626491c..14c92e8 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -32,8 +32,9 @@ RUN echo "test ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers USER test WORKDIR /home/test/ ENV LANG="fr_FR.UTF-8" -RUN git clone --recursive https://github.com/eoli3n/dotfiles -RUN cd /home/test/dotfiles; ./install.sh server | tee ansible.log +RUN mkdir dotfiles +COPY . dotfiles/ +RUN chown -R test:test dotfiles +RUN cd dotfiles; ./install.sh server | tee ansible.log RUN sudo chsh -s '/usr/bin/zsh' test -ADD test.sh . ENTRYPOINT /usr/bin/zsh diff --git a/docker/debian/README.md b/docker/debian/README.md index 6663efc..046a5ad 100644 --- a/docker/debian/README.md +++ b/docker/debian/README.md @@ -1,16 +1,12 @@ -## Store Docker files in /home +## Build and run Locally ``` -sudo cp -R /var/lib/docker /home/ -sudo rm -Rf /var/lib/docker -sudo ln -s /home/docker /var/lib/docker +git clone https://github.com/eoli3n/dotfiles +cd dotfiles +git checkout +sudo docker build -t debian/dotfiles -f docker/debian/Dockerfile . +sudo docker run -t debian/dotfiles ``` -## Clean Docker files -``` -sudo docker system prune -``` - -## Start Docker -``` -sudo docker build -t archlinux-dotfiles . -``` +## User +Login : ``test`` +Password : ``test`` diff --git a/docker/debian/test.sh b/docker/debian/test.sh index 8025803..c3785af 100755 --- a/docker/debian/test.sh +++ b/docker/debian/test.sh @@ -1,2 +1,2 @@ #!/bin/bash -grep 'failed=0' ~/ansible.log +grep 'failed=0' ~/dotfiles/ansible.log diff --git a/vagrant/archlinux/Vagrantfile b/vagrant/archlinux/Vagrantfile index ebf8209..909ab21 100644 --- a/vagrant/archlinux/Vagrantfile +++ b/vagrant/archlinux/Vagrantfile @@ -1,8 +1,6 @@ # -*- mode: ruby -*- # vi: set ft=ruby : - - Vagrant.configure("2") do |config| config.vm.box = "terrywang/archlinux"