Ctr: различия между версиями
Sirmax (обсуждение | вклад) |
Sirmax (обсуждение | вклад) |
||
Строка 10: | Строка 10: | ||
/usr/bin/ctr containers ls |
/usr/bin/ctr containers ls |
||
</code> |
</code> |
||
+ | |||
+ | |||
+ | $ ctr images pull docker.io/library/nginx:1.21 |
||
+ | $ ctr images pull docker.io/kennethreitz/httpbin:latest |
||
+ | $ ctr images pull docker.io/kennethreitz/httpbin:latest |
||
+ | $ ctr images pull quay.io/quay/redis:latest |
||
+ | To list local images, one can use: |
||
+ | |||
+ | $ ctr images ls |
||
+ | |||
+ | |||
+ | $ docker build -t my-app . |
||
+ | $ docker save -o my-app.tar my-app |
||
+ | |||
+ | $ ctr images import my-app.tar |
||
+ | |||
+ | |||
+ | $ mkdir /tmp/httpbin |
||
+ | $ ctr images mount docker.io/kennethreitz/httpbin:latest /tmp/httpbin |
||
+ | |||
+ | $ ls -l /tmp/httpbin/ |
||
+ | total 80 |
||
+ | drwxr-xr-x 2 root root 4096 Oct 18 2018 bin |
||
+ | drwxr-xr-x 2 root root 4096 Apr 24 2018 boot |
||
+ | drwxr-xr-x 4 root root 4096 Oct 18 2018 dev |
||
+ | drwxr-xr-x 1 root root 4096 Oct 24 2018 etc |
||
+ | drwxr-xr-x 2 root root 4096 Apr 24 2018 home |
||
+ | drwxr-xr-x 3 root root 4096 Oct 24 2018 httpbin |
||
+ | ... |
||
+ | |||
+ | $ ctr images unmount /tmp/httpbin |
||
+ | |||
+ | |||
+ | |||
+ | ctr run --rm -t docker.io/library/debian:latest cont1 |
||
+ | |||
+ | |||
+ | |||
+ | =Ссылки= |
||
+ | https://iximiuz.com/en/posts/containerd-command-line-clients/ |
Версия 10:30, 26 апреля 2023
Шпаргалка
Список контейнеров
/usr/bin/ctr containers ls
$ ctr images pull docker.io/library/nginx:1.21
$ ctr images pull docker.io/kennethreitz/httpbin:latest
$ ctr images pull docker.io/kennethreitz/httpbin:latest
$ ctr images pull quay.io/quay/redis:latest
To list local images, one can use:
$ ctr images ls
$ docker build -t my-app .
$ docker save -o my-app.tar my-app
$ ctr images import my-app.tar
$ mkdir /tmp/httpbin
$ ctr images mount docker.io/kennethreitz/httpbin:latest /tmp/httpbin
$ ls -l /tmp/httpbin/ total 80 drwxr-xr-x 2 root root 4096 Oct 18 2018 bin drwxr-xr-x 2 root root 4096 Apr 24 2018 boot drwxr-xr-x 4 root root 4096 Oct 18 2018 dev drwxr-xr-x 1 root root 4096 Oct 24 2018 etc drwxr-xr-x 2 root root 4096 Apr 24 2018 home drwxr-xr-x 3 root root 4096 Oct 24 2018 httpbin ...
$ ctr images unmount /tmp/httpbin
ctr run --rm -t docker.io/library/debian:latest cont1
Ссылки
https://iximiuz.com/en/posts/containerd-command-line-clients/