|
|
(31 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| == Docker First Steps == | | == Docker related info broken down in chapters == |
|
| |
|
| === Installation ===
| | [[ Docker First Steps ]] |
| <code>
| |
| apt-get install -y apt-transport-https ca-certificates surl software-properties-common
| |
| </code> <br>
| |
|
| |
|
| If needed import the docker repo <br>
| | [[ Building Containerized Applications ]] |
| <code>
| |
| apt-get update
| |
| </code> <br>
| |
|
| |
|
| Install Docker <br>
| | [[ Docker Networking ]] |
| <code>
| |
| apt-get install docker-ce
| |
| </code> <br>
| |
|
| |
|
| === Useful commands ===
| | [[ Docker Compose ]] |
|
| |
|
| Information <br>
| | [[ Scaling ]] |
| <code>
| |
| docker info
| |
| </code> <br>
| |
|
| |
|
| Check Version of client and server <br>
| | [[Category:Docker]] |
| <code>
| |
| docker version
| |
| </code> <br>
| |
| | |
| Search images (usually from hub.docker.com) <br>
| |
| <code>
| |
| docker search ''image''
| |
| </code> <br>
| |
| | |
| Get images you want to run <br>
| |
| <code>
| |
| docker pull ''image''
| |
| </code> <br>
| |
| | |
| Show the images <br>
| |
| <code>
| |
| docker image
| |
| </code> <br>
| |
| | |
| Run an image in a container <br>
| |
| <code>
| |
| docke run ''image''
| |
| </code> <br>
| |
| | |
| Stop the container <br>
| |
| <code>
| |
| docker stop ''image''
| |
| </code> <br>
| |
| | |
| Start the container <br>
| |
| <code>
| |
| docker stop ''image''
| |
| </code> <br>
| |
| | |
| Remove the image <br>
| |
| <code>
| |
| docker rm ''image''
| |
| </code> <br>
| |
| | |
| === Hello world example ===
| |
| Search images <br>
| |
| <code>
| |
| docker search ''image''
| |
| </code> <br>
| |
| | |
| Run Hello World (Shows a Hello World message on the commandline) <br>
| |
| <code>
| |
| docker pull hello-world
| |
| docker run hello-world
| |
| </code> <br>
| |
| | |
| Stop Hello World <br>
| |
| <code>
| |
| docker stop hello-world
| |
| </code> <br>
| |
| | |
| Get rid of it <br>
| |
| <code>
| |
| docker rm hello-world
| |
| </code> <br>
| |
| | |
| === HTTPD Example ===
| |
| Run httpd webserver <br>
| |
| <code>
| |
| docker pull httpd
| |
| docker run httpd
| |
| </code> <br>
| |
| | |
| Run http and expose it to the outside world (''-p container:host'') <br>
| |
| <code>
| |
| docker run -p 80:80 --name web01 -d httpd
| |
| </code> <br>
| |
| | |
| Show running containers <br>
| |
| <code>
| |
| docker ps
| |
| </code> <br>
| |
| | |
| Get stuff from the webserver <br>
| |
| <code>
| |
| curl localhost
| |
| </code> <br>
| |
| | |
| Stop the container <br>
| |
| <code>
| |
| docker stop web01
| |
| </code> <br>
| |
| | |
| Remove the container <br>
| |
| <code>
| |
| docker rm web01
| |
| </code> <br>
| |
| | |
| == Docker Adding Persistance Storage ==
| |
| | |
| This provides the local data to run in the container, for instance the data for the website
| |
| | |
| Expose a folder to the container method 1 <br>
| |
| <code>
| |
| docker volume create data <br>
| |
| docker run -v /var//www/html:/var/www/ ''httpd''
| |
| </code> <br>
| |
| | |
| Or doing use method 2 <br>
| |
| <code>
| |
| docker run -d v /var/www/html:/var/www ''httpd''
| |
| </code> <br>
| |
| | |
| <br>
| |
| <code>
| |
| docker
| |
| </code> <br>
| |
| | |
| <br>
| |
| <code>
| |
| docker
| |
| </code> <br>
| |
| | |
| <br>
| |
| <code>
| |
| docker
| |
| </code> <br>
| |
| llll
| |
| <br>
| |
| <code>
| |
| docker
| |
| </code> <br>
| |
| | |
| | |
| | |
| | |
| | |
| === Comments ===
| |