3/9/2018

Docker hierarchie enz

Filed under: — cybrarian @ 1:09 pm

Hierarchie

concept:

Stack
Services
Container

container directory/files:

directory/dockerfile
directory/app.py
directory/requirements.txt

Woordenlijst

dockerfile : definiëert de container

Python

Docker lijkt sterk gebruik te maken van Python (zie ook installatie)

Docker in Yast

Filed under: — cybrarian @ 12:46 pm

Installeren:
– Yast, Softwarebeheer, zoek docker
– docker, docker-bash-completion, docker-libnetwork, docker-runc, docker-zhs-completion, ruby2.1-rubygem-docker-api, yast2-docker, zypper-docker (docker-compose)
– installeer.

Controleren:

Yast Control Center, Virtualisatie, Docker.

Start de module met venster YaST2 – docker @ host.loc

Twee tabbladen: Images en Containers.

Containers toont de “running docker containers”

Na het starten van het “Hello World” voorbeeld (zie commando’s), wordt in tabblad [Images] zichtbaar:

hello-world latest sh256:2cb0d 2018-07-11T00:32:08+00:00 1.80 KiB

Docker commando’s

Filed under: — cybrarian @ 12:38 pm

Docker
(voorbeelden op OpenSUSE, volg de gids op docs.docker.com)

Docker installeren:
zypper install docker docker-compose

Docker starten
systemctl start docker

Docker stoppen
systemctl stop docker

Docker automatisch laten starten:
sudo systemctl enable docker

Docker groep vervoegen:
sudo usermod -G docker -a GEBRUIKERSNAAM

Versie van Docker:
host:/home/gebruikersnaam # docker --version

Docker version 17.09.1-ce, build f4ffd2511ce9

Aktieve containers:
host:/home/gebruikersnaam # docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

(niets in gebruik hier)

Meer info:
host:/home/gebruikersnaam # docker info

Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.09.1-ce
Storage Driver: btrfs
Build Version: Btrfs v4.5.3+20160729
Library Version: 101
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc oci
Default Runtime: runc
….

Hallo Wereld!
docker run hello-world

Unable to find image ‘hello-world:latest’ locally
latest: Pulling from library/hello-world
9db2ca6ccae0: Pull complete
Digest: sha256:4b8ff392a12ed9ea17784bd3c9a8b1fa3299cac44aca35a85c90c5e3c7afacdc
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.

# docker image ls

REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 2cb0d9787c4d 7 weeks ago 1.85kB

# docker container ls

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

# docker image ls --all

REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 2cb0d9787c4d 7 weeks ago 1.85kB

# docker image ls -aq

2cb0d9787c4d

(q = quite mode)

Powered by WordPress