« Datasheet/Docker » : différence entre les versions
Aller à la navigation
Aller à la recherche
(Page créée avec « {{Datasheet}} = Docker = == Créer son container == * Téléchargement du container CentOS depuis le dépôt distant (containeur officiel)<syntaxhighlight lang="bash">dock... ») |
Aucun résumé des modifications |
||
| Ligne 3 : | Ligne 3 : | ||
== Créer son container == | == Créer son container == | ||
* Téléchargement du container CentOS depuis le dépôt distant (containeur officiel)<syntaxhighlight lang="bash">docker pull centos</syntaxhighlight> | * Téléchargement du container CentOS depuis le dépôt distant (containeur officiel)<syntaxhighlight lang="bash">docker pull centos</syntaxhighlight> | ||
* | * Utilisation de ce container | ||
** Avec un shell interactif, dans un terminal et affectation du nom ''centos-6''<syntaxhighlight lang="bash">docker run -i -t --name='centos-6' centos /bin/bash</syntaxhighlight> | |||
** Lancement d'une commande directement<syntaxhighlight lang="bash">docker run centos yum update -y</syntaxhighlight> | |||
* Enregistrement sur le dépôt distant (login)<syntaxhighlight lang="bash">docker login</syntaxhighlight> | * Enregistrement sur le dépôt distant (login)<syntaxhighlight lang="bash">docker login</syntaxhighlight> | ||
* Application de nos modification au container (un peu comme le commit d'une transaction SQL)<syntaxhighlight lang="bash">docker commit | * Application de nos modification au container (un peu comme le commit d'une transaction SQL)<syntaxhighlight lang="bash">docker commit <CONTAINER ID> didier13150/centos6</syntaxhighlight> | ||
* Téléversement de notre container<syntaxhighlight lang="bash">docker push didier13150/centos6</syntaxhighlight> | * Téléversement de notre container<syntaxhighlight lang="bash">docker push didier13150/centos6</syntaxhighlight> | ||
{{Admon/tip|Mise à disposition|Maintenant, tout le monde peut télécharger notre container (public par défaut) | {{Admon/tip|Mise à disposition|Maintenant, tout le monde peut télécharger notre container (public par défaut) | ||
<syntaxhighlight lang="bash">docker pull didier13150/centos6</syntaxhighlight>}} | <syntaxhighlight lang="bash">docker pull didier13150/centos6</syntaxhighlight>}} | ||
== Commandes utiles == | |||
* Visualiser la sortie standard (stdout) du container<syntaxhighlight lang="bash">docker logs <CONTAINER ID></syntaxhighlight> | |||
* Attachement à un container<syntaxhighlight lang="bash">docker attach --sig-proxy=false <CONTAINER ID></syntaxhighlight> | |||
* Liste des containers | |||
** Containers actifs<syntaxhighlight lang="bash">docker ps</syntaxhighlight> | |||
** Tous les containers<syntaxhighlight lang="bash">docker ps -a</syntaxhighlight> | |||
* Suppression d'un container<syntaxhighlight lang="bash">docker rm <CONTAINER ID></syntaxhighlight> | |||
* Liste de tous les container déjà téléchargés<syntaxhighlight lang="bash">docker images</syntaxhighlight> | |||
* Recherche d'un container par nom sur https://index.docker.io/<syntaxhighlight lang="bash">docker search <name></syntaxhighlight> | |||
Dernière version du 18 avril 2014 à 15:12
__NOTITLE__
Docker
Créer son container
- Téléchargement du container CentOS depuis le dépôt distant (containeur officiel)
docker pull centos
- Utilisation de ce container
- Avec un shell interactif, dans un terminal et affectation du nom centos-6
docker run -i -t --name='centos-6' centos /bin/bash
- Lancement d'une commande directement
docker run centos yum update -y
- Avec un shell interactif, dans un terminal et affectation du nom centos-6
- Enregistrement sur le dépôt distant (login)
docker login
- Application de nos modification au container (un peu comme le commit d'une transaction SQL)
docker commit <CONTAINER ID> didier13150/centos6
- Téléversement de notre container
docker push didier13150/centos6
Commandes utiles
- Visualiser la sortie standard (stdout) du container
docker logs <CONTAINER ID>
- Attachement à un container
docker attach --sig-proxy=false <CONTAINER ID>
- Liste des containers
- Containers actifs
docker ps
- Tous les containers
docker ps -a
- Containers actifs
- Suppression d'un container
docker rm <CONTAINER ID>
- Liste de tous les container déjà téléchargés
docker images
- Recherche d'un container par nom sur https://index.docker.io/
docker search <name>
