Skip to content

Is it possible to run commands inside of a running Docker container? #506

Answered by yohamta
helmut72 asked this question in Q&A
Discussion options

You must be logged in to vote

@helmut72
Hi thanks for providing the details.
I am afraid that writing a script inside a DAG would be easier for a complex command.

For example:

steps:
  - name: run docker container
    command: bash
    script: |
      docker exec freshrss /bin/bash -c 'for i in $(/usr/bin/php /var/www/html/cli/list-users.php);do /usr/bin/php /var/www/html/cli/db-optimize.php --user $i;done'

This way you can write any bash script inside the field script in the DAG, could you please give it a try?
Thanks!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@helmut72
Comment options

@yohamta
Comment options

Answer selected by helmut72
@helmut72
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants