diff --git a/.travis.yml b/.travis.yml index d20db72..da64bce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,10 @@ install: - docker build -t archlinux/dotfiles . - cd ../debian - docker build -t debian/dotfiles . + - cd ../centos + - docker build -t centos/dotfiles . script: - docker run archlinux/dotfiles test.sh - docker run debian/dotfiles test.sh + - docker run centos/dotfiles test.sh diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile new file mode 100644 index 0000000..ebd810d --- /dev/null +++ b/docker/centos/Dockerfile @@ -0,0 +1,38 @@ +FROM centos:7 +# Locales keyboard +RUN sed -i 's/^\(override_install_langs.*\)$/#\1/' /etc/yum.conf \ + && yum -y -q reinstall glibc-common \ + && echo 'LANG="fr_FR.UTF-8"' > /etc/locale.conf +ENV LANG fr_FR.UTF-8 +# Debian Deps +RUN yum update -y && yum install -y \ + sudo \ + binutils \ + util-linux \ + fakeroot \ + file \ + python \ + make \ + gcc \ + pkg-config \ + perl \ + gnupg2 +ENV PATH="${PATH}:/usr/bin/core_perl" +# Project deps +RUN yum install -y \ + ansible \ + git +# Create test user +RUN useradd -m test \ + && chown -R test:test /home/test \ + && echo -e "dockerpass\ndockerpass" | passwd test +RUN echo "test ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers +# User run +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 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 new file mode 100644 index 0000000..05462ae --- /dev/null +++ b/docker/centos/README.md @@ -0,0 +1,20 @@ +## 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 new file mode 100755 index 0000000..8025803 --- /dev/null +++ b/docker/centos/test.sh @@ -0,0 +1,2 @@ +#!/bin/bash +grep 'failed=0' ~/ansible.log diff --git a/vagrant/centos/Vagrantfile b/vagrant/centos/Vagrantfile index 4cc08a6..c4437d7 100644 --- a/vagrant/centos/Vagrantfile +++ b/vagrant/centos/Vagrantfile @@ -1,8 +1,6 @@ # -*- mode: ruby -*- # vi: set ft=ruby : - - Vagrant.configure("2") do |config| config.vm.box = "centos/7"