running command inside container
-
for an import script I want to run a bash command inside a (here: nextcloud..) container. This instruction to identify the container from the hostname doesn't seem to work anymore:
https://forum.cloudron.io/post/2011
what's the current approach?
-
The script mentioned in the other forum post should still work fine. At its core is the following docker cli line to detect the container id:
docker ps -q -f label=fqdn=$app -f label=isSubcontainer=false
The attributes it filters on have not changed since then.
-
Hi @perler
from the settings of the app on in the Cloudron dashboard you could open a terminal. which will give you access to the container.
You could also use the cloudron cli from your workstation.
cloudron exec --app $locationofyournextcloud
. -
The script mentioned in the other forum post should still work fine. At its core is the following docker cli line to detect the container id:
docker ps -q -f label=fqdn=$app -f label=isSubcontainer=false
The attributes it filters on have not changed since then.
-
-
@perler Have you seen https://docs.cloudron.io/apps/#cron already? This will run the job in the context of a container.
I am happy to add other "meta" patterns, if none of those fit your use case
-