Seite 1 von 1

Docker Grundinstallation Debian/Ubuntu

Verfasst: Don 20. Dez 2018, 16:12
von h3rb3rn
aktualisierte Fassung vom 21.12.2018

Quelle: ... repository

Für Debian:

Code: Alles auswählen

apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common

Code: Alles auswählen

curl -fsSL | sudo apt-key add -

Code: Alles auswählen

apt-key fingerprint 0EBFCD88

Code: Alles auswählen

add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"

Code: Alles auswählen

apt update && apt install docker-ce

Bezugsquelle für fertige Docker Container:

Docker Container über Dockerhub beziehen
docker pull $dockercontainer$

Code: Alles auswählen

docker pull nginx

Docker Installation testen

Code: Alles auswählen

docker run hello-world
# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
d1***2****c****0*: Pull complete
Digest: sha256:**************d*************6****************7*************
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:

For more examples and ideas, visit:
Docker Prozesse anzeigen lassen

Code: Alles auswählen

docker ps -a
*****e*******8******** hello-world "/hello" 18 seconds ago Exited (0) 16 seconds ago heuristic_mccarthy
**a******4******1***** nginx "-d -p 80" 3 minutes ago Created 80/tcp upbeat_banzai
***c*****1****5******* nginx "nginx -g 'daemon of…" 4 minutes ago Exited (0) 4 minutes ago happy_elgamal

Docker Container starten

Quelle: ... untu-14-04

Code: Alles auswählen

sudo docker run --name docker-nginx -p 80:80 -d nginx

Docker Container stopen

Code: Alles auswählen

docker stop docker-nginx && docker rm docker-nginx

Docker Kommando Übersicht unter