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=falseThe attributes it filters on have not changed since then.
-
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?
-
we want to use this in a script which runs locally on the cloudron server - what would be the preferred way here?
-
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=falseThe attributes it filters on have not changed since then.
-
N nebulon marked this topic as a question on
-
it's a one off thing, but preferrable within a script (so it should resolve the local container-id by hostname)
@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

-
G girish has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login