Docker exec solution in Cobia

developideas

Cadet
Joined
Nov 3, 2023
Messages
1
Hi all, since updating to Cobia it appears that the docker command is no longer available.

I'm currently using docker exec on some custom app containers to run some tasks. i.e.

Code:
docker exec -it my_container echo 'hello world'


All the containers are still deployed and managed through the app interface, but is there a way to docker exec from the system level shell after the update?
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
You can by using k3s kubectl exec and getting the rest of the parms set as needed.
 

LarsR

Guru
Joined
Oct 23, 2020
Messages
719
Docker is no longer present in cobia. k3s made an upstream switch from docker to containerd and iX followed that change and docker was completely removed from the base os installation. as sfatula mentioned you'd now need to use k3s kubectl exec.
 

HoPla

Dabbler
Joined
Aug 14, 2023
Messages
11
Editing my cron-job (Paperless-NGX Document Exporter) "docker exec 78799f5558 document_exporter /export/ -c" to

"k3s kubectl exec ix-paperless-ngx -- document_exporter /export -c"

produces the following Error message:

Error from server (NotFound): pods "ix-paperless-ngx" not found

But "k3s kubectl get pod -o wide --all-namespaces" shows the paperless-ngx-pod. What's the problem??

ix-paperless-ngx paperless-ngx-cnpg-main-rw-64bf4c588d-4nplx 1/1 Running 0 66m 172.16.0.56 ix-truenas <none> <none>
ix-paperless-ngx paperless-ngx-cnpg-main-1 1/1 Running 0 66m 172.16.0.58 ix-truenas <none> <none>
ix-paperless-ngx paperless-ngx-redis-0 1/1 Running 0 66m 172.16.0.55 ix-truenas <none> <none>
ix-paperless-ngx paperless-ngx-cnpg-main-2 1/1 Running 0 65m 172.16.0.59 ix-truenas <none> <none>
ix-paperless-ngx paperless-ngx-5757bb6696-4v9wv 1/1 Running 0 66m 172.16.0.54 ix-truenas <none> <none>
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
On non Cobia, the syntax I use is:

k3s kubectl exec -n ix-paperless-ngx paperless-ngx-cnpg-main-rw-64bf4c588d-4nplx -- somecommand

Where paperless-ngx-cnpg-main-rw-64bf4c588d-4nplx is the container name you want to run the command in (You have 5 of them so specify which one). Of course, you can script the container name to make it runnable in the cron job.
 

HoPla

Dabbler
Joined
Aug 14, 2023
Messages
11
@sfatula

You made my day!! :wink:

Thanks. It works :cool:
 
Top