{"id":25557003,"url":"https://github.com/kevin-doolaeghe/initiation-docker","last_synced_at":"2026-02-23T23:30:16.575Z","repository":{"id":181214594,"uuid":"363987050","full_name":"kevin-doolaeghe/initiation-docker","owner":"kevin-doolaeghe","description":"Initiation à Docker","archived":false,"fork":false,"pushed_at":"2021-07-07T08:34:09.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-07-14T14:27:35.606Z","etag":null,"topics":["docker","documentation","learning-by-doing"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevin-doolaeghe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-03T16:08:40.000Z","updated_at":"2023-07-14T14:27:37.986Z","dependencies_parsed_at":null,"dependency_job_id":"baefecc5-d48f-45bb-b5a7-49c838c47305","html_url":"https://github.com/kevin-doolaeghe/initiation-docker","commit_stats":null,"previous_names":["kevin-doolaeghe/initiation-docker"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-doolaeghe%2Finitiation-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-doolaeghe%2Finitiation-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-doolaeghe%2Finitiation-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevin-doolaeghe%2Finitiation-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevin-doolaeghe","download_url":"https://codeload.github.com/kevin-doolaeghe/initiation-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859557,"owners_count":19708861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","documentation","learning-by-doing"],"created_at":"2025-02-20T14:56:28.116Z","updated_at":"2026-02-23T23:30:16.495Z","avatar_url":"https://github.com/kevin-doolaeghe.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker\r\n\r\n## Installation de Docker :\r\n\r\n```\r\nsudo apt install docker.io\r\n```\r\n\r\n## Gestion des images Docker\r\n\r\n### Construction d'une image à partir d'un fichier Dockerfile\r\n\r\nLes fichiers **Dockerfile** décrivent toutes les commandes afin d'automatiser la construction d'une image Docker.\r\n\r\nPar exemple, le fichier **Dockerfile** suivant permet de lancer le script `app.js` de la machine hôte sur le conteneur :\r\n\r\n```\r\nFROM node:alpine\r\nCOPY . /app\r\nWORKDIR /app\r\nCMD node app.js\r\n```\r\n\r\nConstruire une image à partir d'un fichier Dockerfile :\r\n\r\n```\r\nsudo docker build -t [image] [chemin]\r\n```\r\n\r\n### Utiliser une image provenant de Docker Hub\r\n\r\nDe nombreuses images Docker sont disponibles sur le site [Docker Hub](https://hub.docker.com/search?q=\u0026type=image).\r\n\r\nTélécharger une image issue de Docker Hub :\r\n\r\n```\r\nsudo docker pull [auteur]/[conteneur]\r\n```\r\n\r\n### Afficher la liste des images sur la machine hôte :\r\n\r\n```\r\nsudo docker images\r\n```\r\n\r\n### Supprimer une image :\r\n\r\n```\r\nsudo docker rmi [image]\r\n```\r\n\r\n## Gestion des conteneurs\r\n\r\n### Créer et démarrer un conteneur :\r\n\r\n```\r\nsudo docker run --name [conteneur] -d [image]\r\n```\r\n\r\nIl est possible de spécifier des paramètres de démarrage du conteneur :\r\n\r\n```\r\nsudo docker run --name [conteneur] \\\r\n    -v [dossier]:[cible] \\\r\n    -p [port]:[cible] \\\r\n    -d [image]\r\n```\r\n\r\n### Supprimer un conteneur :\r\n\r\n```\r\nsudo docker rm [conteneur]\r\n```\r\n\r\n### Démarrer un conteneur :\r\n\r\n```\r\nsudo docker start [conteneur]\r\n```\r\n\r\n### Arrêter un conteneur :\r\n\r\n```\r\nsudo docker stop [conteneur]\r\n```\r\n\r\n### Entrer dans un conteneur et intéragir avec lui :\r\n\r\n```\r\nsudo docker exec -it [conteneur] [bash|sh]\r\n```\r\n\r\n### Copier des fichiers dans un conteneur :\r\n\r\n```\r\nsudo docker cp [src] [conteneur]:[dst]\r\n```\r\n\r\n### Afficher l'état des conteneurs :\r\n\r\n* Afficher l'état des conteneurs démarrés :\r\n\r\n```\r\nsudo docker ps\r\n```\r\n\r\n* Afficher l'état de tous les conteneurs :\r\n\r\n```\r\nsudo docker ps -a\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevin-doolaeghe%2Finitiation-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevin-doolaeghe%2Finitiation-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevin-doolaeghe%2Finitiation-docker/lists"}