Coder Social home page Coder Social logo

docker-php's Introduction

Docker

Installation de Docker :

Installer Docker (Compatible avec Yakkety 16.10, Xenial 16.04, Trusty 14.04) :

sudo apt-get -y install apt-transport-https ca-certificates curl curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update sudo apt-get -y install docker-ce

Fonctionnement :

Il est possible de récupérer des paquets distants (ex : docker run docker/whalesay) Lors de l'installation d'un container en local, il faut créer un fichier 'Dockerfile' C'est ce fichier qui sera utilisé lors du 'docker build ...'

Installer notre container :

sudo docker build -t {container_name} .

Lancer notre container (sans fichiers partagés):

sudo docker run -it -p {port}:80 {container_name} /bin/bash

Lancer notre container (avec fichiers partagés):

sudo docker run -it -p {port}:80 -v {host_dir}:{container_dir} {container_name} /bin/bash

Quitter notre container (sans exit) :

CTRL+P - CTRL+Q

Reprendre notre container (après un exit) :

  sudo docker ps -l
  sudo docker start {container_id}
  sudo docker attach {container_id}

Commandes utiles :

  • Supprimer un container :
  sudo docker rm {container_id}
  • Supprimer TOUS les containers en status exited :
  sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
  • Supprimer une image :
  sudo docker image rm {repository}:{tag}
  • Forcer la fermeture d'un container (kill) :
  sudo docker kill {container_id}
  • Lister toutes les images :
  sudo docker images
  • Lister les containers :
  sudo docker ps -l
  • Lister tous les containers :
  sudo docker ps -a
  • Sauvegarder une image dans un fichier :
  sudo docker save {repository}:{tag} > {name}.tar
  • Charger une image à l'aide d'un fichier :
  sudo docker load < {name}.tar

docker-php's People

Contributors

francois-mathieu-beclood avatar mapsred avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.