1
0
Fork 0
mirror of https://github.com/eoli3n/dotfiles synced 2024-05-27 01:46:05 +02:00

Merge branch 'docker/debian' into dev

This commit is contained in:
eoli3n 2017-12-27 11:14:19 +01:00
commit de017220fd
6 changed files with 91 additions and 6 deletions

View File

@ -11,6 +11,9 @@ branches:
install:
- cd docker/archlinux
- docker build -t archlinux/dotfiles .
- cd ../debian
- docker build -t debian/dotfiles .
script:
- docker run archlinux/dotfiles test.sh
- docker run debian/dotfiles test.sh

2
TODO
View File

@ -16,3 +16,5 @@
- TODO: docker compose pour build toutes les distros ?
- 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
- TODO: grep -ri 'git clone', dynamic git branch ?

39
docker/debian/Dockerfile Normal file
View File

@ -0,0 +1,39 @@
FROM debian:stable
# Locales keyboard
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i fr_FR -c -f UTF-8 -A /usr/share/locale/locale.alias fr_FR.UTF-8
ENV LANG fr_FR.UTF-8
# Debian Deps
RUN apt-get update && apt-get 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 echo 'deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main' >> /etc/apt/sources.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
RUN apt-get update && apt-get install -y \
ansible \
git
# Create test user
RUN useradd -m test \
&& chown -R test:test /home/test \
&& echo "test\ntest" | 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 sudo chsh -s '/usr/bin/zsh' test
ADD test.sh .
ENTRYPOINT /usr/bin/zsh

16
docker/debian/README.md Normal file
View File

@ -0,0 +1,16 @@
## 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 .
```

2
docker/debian/test.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
grep 'failed=0' ~/ansible.log

View File

@ -1,18 +1,41 @@
---
- name: Configure zsh-syntax-highlighting repo [Debian]
- name: Add zsh-syntax-highlighting repo key [Debian jessie]
apt_key:
url: https://download.opensuse.org/repositories/shells:zsh-users:zsh-syntax-highlighting/Debian_8.0/Release.key
state: present
become: True
when:
- ansible_distribution == "Debian"
- ansible_distribution_release == "jessie"
- name: Add zsh-syntax-highlighting repo key [Debian stretch]
apt_key:
url: https://download.opensuse.org/repositories/shells:zsh-users:zsh-syntax-highlighting/Debian_9.0/Release.key
state: present
become: True
when:
- ansible_distribution == "Debian"
- ansible_distribution_release == "stretch"
- name: Configure zsh-syntax-highlighting repo [Debian jessie]
apt_repository:
repo: 'deb http://download.opensuse.org/repositories/shells:/zsh-users:/zsh-syntax-highlighting/Debian_8.0/ /'
state: present
update_cache: yes
become: True
when: ansible_distribution == "Debian"
when:
- ansible_distribution == "Debian"
- ansible_distribution_release == "jessie"
- name: Add zsh-syntax-highlighting repo key [Debian]
apt_key:
url: https://download.opensuse.org/repositories/shells:zsh-users:zsh-syntax-highlighting/Debian_8.0/Release.key
- name: Configure zsh-syntax-highlighting repo [Debian stretch]
apt_repository:
repo: 'deb http://download.opensuse.org/repositories/shells:/zsh-users:/zsh-syntax-highlighting/Debian_9.0/ /'
state: present
update_cache: yes
become: True
when: ansible_distribution == "Debian"
when:
- ansible_distribution == "Debian"
- ansible_distribution_release == "stretch"
- name: Install zsh [Debian]
apt: name={{item}} state=present force=yes update_cache=yes