|
|
(4 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| == Other stuff and work in progress that does not have it's own section yet ==
| |
| == Docker ==
| |
| ------
| |
| === Installation ===
| |
| <code>
| |
| apt-get install -y apt-transport-https ca-certificates surl software-properties-commn
| |
| </code> <br>
| |
|
| |
|
| If needed import the docker repo
| |
| <code>
| |
| apt-get update
| |
| </code> <br>
| |
|
| |
| Install Docker
| |
| <code>
| |
| apt-get install docker-ce
| |
| </code> <br>
| |
|
| |
| === Useful commands ===
| |
|
| |
| Information
| |
| <code>
| |
| docket info
| |
| </code> <br>
| |
|
| |
| Check Version of client and server
| |
| <code>
| |
| docker version
| |
| </code> <br>
| |
|
| |
|
| |
| Search images (usually from hub.docker.com)
| |
| <code>
| |
| docker search ''image''
| |
| </code> <br>
| |
|
| |
| Get images you want to run
| |
| <code>
| |
| docker pull ''image''
| |
| </code> <br>
| |
|
| |
| Show the images
| |
| <code>
| |
| docker image
| |
| </code> <br>
| |
|
| |
| Run an image
| |
| <code>
| |
| docke run ''image''
| |
| </code> <br>
| |
|
| |
| Search images
| |
| <code>
| |
| docker search ''image''
| |
| </code> <br>
| |
|
| |
| Run Hello World (Shows a Hello World message on the commandline)
| |
| <code>
| |
| docker pull hello-world
| |
| docker run hello-world
| |
| </code> <br>
| |
| Shows a Hello World and message on the commandline <br>
| |
|
| |
| Run httpd webserver
| |
| <code>
| |
| docker pull httpd
| |
| docker run httpd
| |
| </code> <br>
| |
|
| |
| Run http and expose it to the outside world (''-p container:host'')
| |
| <code>
| |
| docker run -p 80:80 --name web01 -d httpd
| |
| </code> <br>
| |
|
| |
| Show running containers
| |
| <code>
| |
| docker ps
| |
| </code> <br>
| |
|
| |
| Get stuff from the webserver
| |
| <code>
| |
| curl localhost
| |
| </code> <br>
| |
|
| |
| Stop the container
| |
| <code>
| |
| docker stop web01
| |
| </code> <br>
| |
|
| |
| Remove the container
| |
| <code>
| |
| docker rm web01
| |
| </code> <br>
| |
|
| |
| === Comments ===
| |