mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	Add custom pre-built docker images to be used for the CI
This commit is contained in:
		
							
								
								
									
										18
									
								
								docker_ci/Dockerfile.37
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								docker_ci/Dockerfile.37
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
FROM debian:buster-backports
 | 
			
		||||
 | 
			
		||||
LABEL maintainer="otthorn@crans.org"
 | 
			
		||||
LABEL description="Debian Buster backports image with django and tox \
 | 
			
		||||
installed for testing purposes"
 | 
			
		||||
 | 
			
		||||
RUN apt-get update \
 | 
			
		||||
        && apt-get install --no-install-recommends -t buster-backports -y \
 | 
			
		||||
        python3-django python3-django-crispy-forms \
 | 
			
		||||
        python3-django-extensions python3-django-filters \
 | 
			
		||||
		python3-django-polymorphic \
 | 
			
		||||
        python3-djangorestframework python3-django-oauth-toolkit \
 | 
			
		||||
		python3-psycopg2 python3-pil \
 | 
			
		||||
        python3-babel python3-lockfile python3-pip python3-phonenumbers \
 | 
			
		||||
		python3-memcache \
 | 
			
		||||
        python3-bs4 python3-setuptools tox texlive-xetex \
 | 
			
		||||
		&&  apt-get clean \
 | 
			
		||||
		&& rm -rf /var/lib/apt/lists/*
 | 
			
		||||
							
								
								
									
										22
									
								
								docker_ci/Dockerfile.38
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								docker_ci/Dockerfile.38
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
FROM ubuntu:20.04
 | 
			
		||||
 | 
			
		||||
LABEL maintainer="otthorn@crans.org"
 | 
			
		||||
LABEL description="Ubuntu 20.04 image with django and tox \
 | 
			
		||||
installed for testing purposes"
 | 
			
		||||
 | 
			
		||||
# fix tzdata prompt
 | 
			
		||||
RUN ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime && echo Europe/Paris > /etc/timezone
 | 
			
		||||
 | 
			
		||||
RUN apt-get update \
 | 
			
		||||
        && apt-get install --no-install-recommends -y \
 | 
			
		||||
        python3-django python3-django-crispy-forms \
 | 
			
		||||
        python3-django-extensions python3-django-filters \
 | 
			
		||||
		python3-django-polymorphic \
 | 
			
		||||
        python3-djangorestframework python3-django-oauth-toolkit \
 | 
			
		||||
		python3-psycopg2 python3-pil \
 | 
			
		||||
        python3-babel python3-lockfile python3-pip python3-phonenumbers \
 | 
			
		||||
		python3-memcache \
 | 
			
		||||
        python3-bs4 python3-setuptools tox texlive-xetex \
 | 
			
		||||
		&&  apt-get clean \
 | 
			
		||||
		&& rm -rf /var/lib/apt/lists/*
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										18
									
								
								docker_ci/Dockerfile.39
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								docker_ci/Dockerfile.39
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
FROM debian:bullseye
 | 
			
		||||
 | 
			
		||||
LABEL maintainer="otthorn@crans.org"
 | 
			
		||||
LABEL description="Debian Bulleye image with django and tox \
 | 
			
		||||
installed for testing purposes"
 | 
			
		||||
 | 
			
		||||
RUN apt-get update \
 | 
			
		||||
        && apt-get install --no-install-recommends -y \
 | 
			
		||||
        python3-django python3-django-crispy-forms \
 | 
			
		||||
        python3-django-extensions python3-django-filters \
 | 
			
		||||
		python3-django-polymorphic \
 | 
			
		||||
        python3-djangorestframework python3-django-oauth-toolkit \
 | 
			
		||||
		python3-psycopg2 python3-pil \
 | 
			
		||||
        python3-babel python3-lockfile python3-pip python3-phonenumbers \
 | 
			
		||||
		python3-memcache \
 | 
			
		||||
        python3-bs4 python3-setuptools tox texlive-xetex \
 | 
			
		||||
		&&  apt-get clean \
 | 
			
		||||
		&& rm -rf /var/lib/apt/lists/*
 | 
			
		||||
							
								
								
									
										21
									
								
								docker_ci/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								docker_ci/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
# Docker CI
 | 
			
		||||
 | 
			
		||||
Ce dossier contient les images docker à construire pour la CI.  L'idée est
 | 
			
		||||
d'avoir une image pré-construire, au dessus laquel il y a besoin de faire
 | 
			
		||||
tourner uniquement les commandes qui nous intéresse. Cela permet notamment de
 | 
			
		||||
réduire drastiquement le temps que nécessite chaque test car seul la dernière
 | 
			
		||||
couche (layer) de l'image a besoin d'etre éxécuter.
 | 
			
		||||
 | 
			
		||||
## Build les images
 | 
			
		||||
 | 
			
		||||
Pour build les images il suffit de lancer les commandes suivantes
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
cd docker_ci/
 | 
			
		||||
docker build -t nk20_ci_37 -f Dockerfile.37 .
 | 
			
		||||
docker build -t nk20_ci_38 -f Dockerfile.38 .
 | 
			
		||||
docker build -t nk20_ci_39 -f Dockerfile.39 .
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Elles sont acutellement build et disponible sur dockerhub
 | 
			
		||||
https://hub.docker.com/otthorn/nk20_ci_37
 | 
			
		||||
							
								
								
									
										16
									
								
								docker_ci/TODO.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								docker_ci/TODO.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
## TODO
 | 
			
		||||
- Créer les images
 | 
			
		||||
- Build les images
 | 
			
		||||
- Push les images sur la docker registery de mon choix (docker hub
 | 
			
		||||
  probablement)
 | 
			
		||||
- Tester la CI avec les images pré construite pour voir tout fonctionnne comme
 | 
			
		||||
  avant
 | 
			
		||||
- Créer une CI pour les images docker elle meme (hadolin)
 | 
			
		||||
- Créer une CI pour les images docker de la note
 | 
			
		||||
- Créer une CI pour ansible
 | 
			
		||||
- Créer la MR
 | 
			
		||||
- Demande de merge de la MR
 | 
			
		||||
 | 
			
		||||
## Optionnel
 | 
			
		||||
- build automatique des images par la CI
 | 
			
		||||
- utiliser le gitlab registery local une fois qu'il sera activé
 | 
			
		||||
		Reference in New Issue
	
	Block a user