# Multiple commands

**URL:** <https://forums.docker.com/t/multiple-commands/128450>\
**Category:** Docker Hub\
**Tags:** docker\
**Created:** [August 31, 2022, 11:44am UTC](https://forums.docker.com/t/multiple-commands/128450 "2022-08-31T11:44:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caedenph](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/caedenph/32/33006_2.png) [@caedenph](https://forums.docker.com/u/caedenph)\
**Post date:** [August 31, 2022, 11:44am UTC](https://forums.docker.com/t/multiple-commands/128450/1 "2022-08-31T11:44:29Z")

</div>

This is the `run.sh` that I use to currently execute my code

```nohighlight
letters=( "a" "b" "c" "d" )
for i in "${letters[@]}"
do
    python main.py $i &
done

```

This passes the letter into my `main.py` which I can then use.

How do I rewrite this in docker, considering I can only use on `CMD` command?

I think I should use `docker-compose` for this but I don’t know how

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [August 31, 2022, 11:49am UTC](https://forums.docker.com/t/multiple-commands/128450/2 "2022-08-31T11:49:46Z")

</div>

You could use the [COPY](https://docs.docker.com/engine/reference/builder/#copy) instruction in your Dockerfie to copy run.sh into the image and use the [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint) instruction (make sure to use the exec form!) to call it as entrypoint script.
