|
|
(38 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| == Docker == | | == Docker related info broken down in chapters == |
| ------
| |
| === Installation ===
| |
| <code>
| |
| apt-get install -y apt-transport-https ca-certificates surl software-properties-common
| |
| </code> <br>
| |
|
| |
|
| If needed import the docker repo <br>
| | [[ Docker First Steps ]] |
| <code>
| |
| apt-get update
| |
| </code> <br>
| |
|
| |
|
| Install Docker <br>
| | [[ Building Containerized Applications ]] |
| <code>
| |
| apt-get install docker-ce
| |
| </code> <br>
| |
|
| |
|
| === Useful commands ===
| | [[ Docker Networking ]] |
|
| |
|
| Information <br>
| | [[ Docker Compose ]] |
| <code>
| |
| docker info
| |
| </code> <br>
| |
|
| |
|
| Check Version of client and server <br>
| | [[ Scaling ]] |
| <code>
| |
| docker version
| |
| </code> <br>
| |
|
| |
|
| Search images (usually from hub.docker.com) <br>
| | [[Category:Docker]] |
| <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 web01
| |
| </code> <br>
| |
| | |
| 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>
| |
| | |
| 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>
| |
| | |
| Remove the container <br>
| |
| <code>
| |
| docker rm web01
| |
| </code> <br>
| |
| | |
| === Comments ===
| |
Latest revision as of 23:13, 24 April 2020