Morgens beim Kaffee mal schnell was ausprobieren
Das Docker Image vom Kamil auf eine SD-Karte gebügelt. Ab in den ROCKPro64 und starten.
Docker ?
rock64@rockpro64:~$ docker
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default
"/home/rock64/.docker")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level
("debug"|"info"|"warn"|"error"|"fatal")
(default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default
"/home/rock64/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default
"/home/rock64/.docker/cert.pem")
--tlskey string Path to TLS key file (default
"/home/rock64/.docker/key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Management Commands:
config Manage Docker configs
container Manage containers
image Manage images
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a Dockerfile
commit Create a new image from a container's changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
deploy Deploy a new stack or update an existing stack
diff Inspect changes to files or directories on a container's filesystem
events Get real time events from the server
exec Run a command in a running container
export Export a container's filesystem as a tar archive
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
login Log in to a Docker registry
logout Log out from a Docker registry
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
ps List containers
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
version Show the Docker version information
wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
Ok, Docker ist installiert und läuft.
Hello World
rock64@rockpro64:~$ sudo docker run -t ubuntu:18.04 /bin/echo "Hello World"
[sudo] password for rock64:
Unable to find image 'ubuntu:18.04' locally
18.04: Pulling from library/ubuntu
7dc40899884d: Pull complete
3c3b1bd6c6b3: Pull complete
f2b826692f9c: Pull complete
836583884d3e: Pull complete
27ede898dd26: Pull complete
Digest: sha256:de774a3145f7ca4f0bd144c7d4ffb2931e06634f11529653b23eba85aef8e378
Status: Downloaded newer image for ubuntu:18.04
Hello World
Nicht wirklich spannend
nginx
rock64@rockpro64:~$ sudo docker run -d --name demo_nginx -p 80:80 nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
8d586fc79193: Pull complete
542be7cb76c8: Pull complete
4c1ed6d3c37c: Pull complete
Digest: sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3
Status: Downloaded newer image for nginx:latest
0b603cb5fa5b4ebf9113eb916b4dbc3d2cf48db8edf5b744d8b40eb6792b22dc
Jetzt haben wir einen Docker Container mit nginx am Laufen. Mit dem Befehl docker ps kann man sich die laufenden Container anzeigen lassen.
rock64@rockpro64:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0b603cb5fa5b nginx "nginx -g 'daemon of…" 8 seconds ago Up 7 seconds 0.0.0.0:80->80/tcp demo_nginx
Adminstrieren des Docker Containers
sudo docker exec -it 0b603cb5fa5b bash
und schwupps, sind wir auf der Konsole.
Mal eben nano nachinstallieren.
root@0b603cb5fa5b:/# apt-get update
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main arm64 Packages [421 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch-updates/main arm64 Packages [5096 B]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main arm64 Packages [6940 kB]
Fetched 7672 kB in 3s (1962 kB/s)
Reading package lists... Done
root@0b603cb5fa5b:/# apt-get install nano
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
spell
The following NEW packages will be installed:
nano
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 474 kB of archives.
After this operation, 2088 kB of additional disk space will be used.
Get:1 http://cdn-fastly.deb.debian.org/debian stretch/main arm64 nano arm64 2.7.4-1 [474 kB]
Fetched 474 kB in 0s (764 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package nano.
(Reading database ... 7135 files and directories currently installed.)
Preparing to unpack .../nano_2.7.4-1_arm64.deb ...
Unpacking nano (2.7.4-1) ...
Setting up nano (2.7.4-1) ...
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/editor.1.gz because associated file /usr/share/man/man1/nano.1.gz (of link group editor) doesn't exist
update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/pico.1.gz because associated file /usr/share/man/man1/nano.1.gz (of link group pico) doesn't exist
Was müssen wir noch testen? Ob nginx läuft. Dazu im Webbrowser folgendes eingeben
http://192.168.3.19/
Das ist jetzt die IP-Adresse, mit der mein ROCKPro64 läuft.
Soweit, sieht das ja brauchbar aus. Mal ein wenig mit rumspielen
Docker Befehle
Stoppen
rock64@rockpro64:~$ sudo docker stop 0b603cb5fa5b
0b603cb5fa5b
Starten
rock64@rockpro64:~$ sudo docker start 0b603cb5fa5b
0b603cb5fa5b
Und es gibt noch viel mehr da zu entdecken. Wird fortgesetzt......