Оценить:
 Рейтинг: 0

IT Cloud

Автор
Год написания книги
2021
<< 1 ... 4 5 6 7 8 9 10 11 12 ... 73 >>
На страницу:
8 из 73
Настройки чтения
Размер шрифта
Высота строк
Поля

* Main metrics – collection of metrics;

* Logs collect – collecting logs;

* Scheduled JOBs;

* Autentification;

* Federation – distribution by data centers;

* Helm is a package manager similar to Docker Hub.

https://www.youtube.com/watch?v=FvlwBWvI-Zg

Docker commands

Docker is a more modern counterpart to RKT containers.

In Linux, when a process terminates with PID = 1, then NameSpace is also buried, which leads to the shutdown of the OS, in the case of a container, similarly, since it is a special case of the OS. The delimitation of processes in itself does not provide additional overhead, as well as monitoring and limiting resources for processes, because systemd provides the same configuration options in the host OS. Network virtualization occurs completely: both localhost and bridge, which allows you to create bridges from several containers to one localhost and thereby make it a single one for them, which is actively used in POD Kubernetes.

Run a temporary container interactively -it . To enter, you need to press Ctrl + D, which will send a signal to shutdown, after which it will be removed by –rm to avoid clogging the system with stopped modern containers. If the image is created in such a way that the application is launched in the shell in the container, which is wrong, then the signal will be poisoned to the application, and the container will continue to work with the shell, in which case, to exit in a separate terminal, you will need to kill it by its name –name name_container. For instance,:

Docker run –rm -it –name name_container ubuntu BASH

In the beginning, the Docker CLI had a simple set of commands to manage the lifecycle of containers. Among them:

* Docker run to run the container;

* Docker ps to view running containers;

* Docker rm to remove a container;

* Docker build to create your own image;

* Docker images to view existing containers;

* Docker rmi to remove the image.

But with the growing popularity, the teams became more and more and it was decided to group them into groups, so instead of the simple "Docker run", the "Docker container" command appeared, which has 25 commands in the 19 version of Docker. These are cleanup, and stop and restore, and logs and various kinds of container connections. The same fate befell the work with images. But, the old commands have remained so far due to compatibility and convenience, because in most cases a basic set is required. Let's stop at it:

Starting a container:

docker run -d –name name_container ubuntu bash

Remove a running container:

docker rm -f name_container

Output of all containers:

docker ps -a

Output of running containers:

docker ps

Output of containers with consumed resources:

docker stats

Displaying processes in a container:

docker top {name_container}

Connect to the container through the sh shell (there is no BASH in alpine containers):

docker exec -it sh

Cleaning the system from unused images:

docker image prune

Remove hanging images:

docker rmi $ (docker images -f "dangling = true" -q)

Show image:

docker images

Create image in dir folder with Dockerfile:

docker build -t docker_user / name_image dir

Delete image:

docker rmi docker_user / name_image dir

Connect to Docker hub:

docker login

Submit the latest revision (the tag is added and shifted automatically, if not specified otherwise) the image on the Docker hub:

docker push ocker_user / name_image dir: latest

For a broader list at https://niqdev.github.io/devops/docker/.

Building a Docker Machine can be described in the following steps:
<< 1 ... 4 5 6 7 8 9 10 11 12 ... 73 >>
На страницу:
8 из 73