Posts tagged ‘Installation’

Erste Schritte mit Docker

Nachdem ich auf meinem NAS (einem Synology DS918+) bereits Erfahrungen mit Docker sammeln konnte, will ich jetzt mehr über die Grundlagen lernen. Ziel ist es mittelfristig, Node Red laufen zu lassen, um einige Aspekte unseres trauten Heims zu automatisieren. Zur Entwicklung nehme ich einen älteren Intel NUC mit i3-Prozesser, auf dem ein Ubuntu Bionic läuft, später landet vielleicht alles auf dem Raspi, den ich in die Unterversorgung gehängt habe.

In diesem Artikel geht es jetzt um die Installation, im wesentlichen folge ich dabei der Anleitung von https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04

1) Herausfinden, welche Ubuntu-Version man hat?

lsb_release -a

gibt in der letzten Zeile den Namen mit aus.

2)

sudo apt update

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

aktualisiert die Quellen und fügt einige benötigte Programme hinzu, so sie noch nicht installiert sind.

3)

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

holt den public PGP-Key von der Docker-Seite, da wir von dort und nicht aus den Bionic-Quellen von Canonical installieren.

4)

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update

fügt die Quellen hinzu und aktualisiert die apt-Quellen

5)

sudo apt install docker-ce

installiert dann Docker.

Wie kann man die Installation prüfen? Mit „Hello World“ 🙂

sudo docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
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.
    (amd64)
 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:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Im nächsten Artikel zum Thema erläutern wir dann die wichtigsten Docker-Befehle für die Kommandozeile.

Uwe

Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined. Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.

More Posts - Website