From 6943848f24e53da5daab33d429a6e749866d8e38 Mon Sep 17 00:00:00 2001 From: spham Date: Fri, 6 Jun 2025 09:55:20 +0200 Subject: [PATCH] Add README.md --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c4aaeaf --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +Pour créer un conteneur Docker avec systemd pour Ubuntu 24.04, suivez ces étapes : + +1. Créez un fichier Dockerfile avec le contenu suivant : + +```dockerfile +FROM ubuntu:24.04 + +# Installer systemd +RUN apt-get update && apt-get install -y systemd + +# Configurer systemd +RUN cd /lib/systemd/system/sysinit.target.wants/ && \ + ls | grep -v systemd-tmpfiles-setup | xargs rm -f $1 + +RUN rm -f /lib/systemd/system/multi-user.target.wants/* \ + /etc/systemd/system/*.wants/* \ + /lib/systemd/system/local-fs.target.wants/* \ + /lib/systemd/system/sockets.target.wants/*udev* \ + /lib/systemd/system/sockets.target.wants/*initctl* \ + /lib/systemd/system/basic.target.wants/* \ + /lib/systemd/system/anaconda.target.wants/* + +# Définir le point d'entrée +ENTRYPOINT ["/lib/systemd/systemd"] +``` + +2. Construisez l'image Docker : + +```bash +docker build -t ubuntu-24.04-systemd . +``` + +3. Lancez le conteneur avec les options nécessaires pour systemd : + +```bash +docker run -d --name ubuntu-24.04-systemd --privileged \ + --cgroupns=host \ + --tmpfs /run \ + --tmpfs /run/lock \ + --tmpfs /tmp \ + -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ + ubuntu-24.04-systemd +``` + +Cette configuration permet d'exécuter un conteneur Ubuntu 24.04 avec systemd activé[3][4]. Vous pouvez maintenant utiliser ce conteneur comme base pour vos applications nécessitant systemd[7]. + +Citations: +[1] https://www.linuxtuto.com/how-to-install-docker-on-ubuntu-24-04/ +[2] https://www.fosstechnix.com/how-to-install-docker-on-ubuntu-24-04-lts/ +[3] https://jeci.fr/fr/blog/2020/0729-run-docker-with-systemd/ +[4] https://github.com/trfore/docker-ubuntu2404-systemd +[5] https://www.youtube.com/watch?v=J4dZ2jcpiP0 +[6] https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04-fr +[7] https://www.rosehosting.com/blog/how-to-install-docker-on-ubuntu-24-04/ +[8] https://rdr-it.com/ubuntu-24-04-installation-de-docker-et-docker-compose/ +[9] https://alexhost.com/fr/faq/guide-dinstallation-et-dutilisation-de-docker-sur-ubuntu/ +[10] https://www.cherryservers.com/blog/install-docker-ubuntu +[11] https://www.hostinger.fr/tutoriels/installer-docker-sur-ubuntu + +--- +Réponse de Perplexity: pplx.ai/share \ No newline at end of file