Ctr: различия между версиями
Sirmax (обсуждение | вклад) |
Sirmax (обсуждение | вклад) |
||
(не показана 1 промежуточная версия этого же участника) | |||
Строка 10: | Строка 10: | ||
/usr/bin/ctr containers ls |
/usr/bin/ctr containers ls |
||
</code> |
</code> |
||
+ | |||
+ | |||
+ | <code>ctr images pull docker.io/library/nginx:1.21</code> |
||
+ | $ 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:34, 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/