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