# Dealing with executable docker image

**URL:** <https://community.seqera.io/t/dealing-with-executable-docker-image/794>\
**Category:** Ask for help\
**Tags:** nextflow, nf-core\
**Created:** [May 29, 2024, 2:19am UTC](https://community.seqera.io/t/dealing-with-executable-docker-image/794 "2024-05-29T02:19:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rebeccasenft](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/rebeccasenft/32/722_2.png) [@rebeccasenft](https://community.seqera.io/u/rebeccasenft)\
**Post date:** [May 29, 2024, 2:19am UTC](https://community.seqera.io/t/dealing-with-executable-docker-image/794/1 "2024-05-29T02:19:08Z")

</div>

Hi all,

I think an issue I’m having stems from a docker container that is an executable I think (it appears to have a [defined entry point](https://github.com/CellProfiler/distribution/blob/0f42b09c3effb29aec119fb2b66130930a805f01/docker/Dockerfile#L22C1-L22C28)). I can run docker just fine outside of nextflow with a command like the following:

```auto
docker run \
        --volume=/Users/senft/Documents/test_input:/input \
        --volume=/Users/senft/Documents/test_output:/output \
        cellprofiler/cellprofiler:4.2.6 \
        --image-directory /input \
        --output-directory /output \
        --pipeline /input/nucleoli.cppipe

```

But in nextflow, I error before I can so much as echo some text in my process where I use this container because of the entry point. What can I do to get around this? Is there a way to just pass in the flags or otherwise change the script to work with an executable container? I’m trying to use the nf-core style for making this module.

Thanks!

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [May 29, 2024, 3:29am UTC](https://community.seqera.io/t/dealing-with-executable-docker-image/794/2 "2024-05-29T03:29:54Z")

</div>

Hi @rebeccasenft

You can try to overwrite the entry point through the `containerOptions` process directive. Nextflow expects `/bin/bash` as entry point, so that’s what you should overwrite the entry point with. Check the example below:

```auto
process FOO {
  containerOptions '--entrypoint /bin/bash' 
  ...
}

```

---

<div class="post-metadata">

**Author:** ![rebeccasenft](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/rebeccasenft/32/722_2.png) [@rebeccasenft](https://community.seqera.io/u/rebeccasenft)\
**Post date:** [May 29, 2024, 3:59am UTC](https://community.seqera.io/t/dealing-with-executable-docker-image/794/3 "2024-05-29T03:59:32Z")

</div>

Thanks for the advice!

I’ve modified the process with containerOptions as you specified, but unfortunately I’m getting an error:

```auto
Command error:
  WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
  /bin/bash: /bin/bash: cannot execute binary file

```

(Ignore that first warning). When I search for `/bin/bash: /bin/bash: cannot execute binary file` I found [this](https://github.com/moby/moby/issues/5539) that suggests adding a “-s” flag bypasses the issue, but I can’t figure out how to do this with containerOptions. My attempt with "containerOptions “–entrypoint /bin/bash cellprofiler/cellprofiler:4.2.6 -s” did not work. Do you have any suggestions for things to try?

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [May 29, 2024, 4:03am UTC](https://community.seqera.io/t/dealing-with-executable-docker-image/794/4 "2024-05-29T04:03:46Z")

</div>

The `-s` in this link would be `containerOptions '--entrypoint /bin/bash -s'` in your case.

You should check if bash is installed in your container image. Every container image to be used with Nextflow should have a few tools installed such as bash, ps, among others (check [here](https://www.nextflow.io/docs/latest/container.html#containers)).

---

<div class="post-metadata">

**Author:** ![Adam\_Talbot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/adam_talbot/32/62_2.png) [@Adam\_Talbot](https://community.seqera.io/u/Adam_Talbot)\
**Post date:** [May 29, 2024, 9:37am UTC](https://community.seqera.io/t/dealing-with-executable-docker-image/794/5 "2024-05-29T09:37:46Z")

</div>

Are you using a modern mac? There’s a whole world of fun with Docker on Apple Silicon, but adding this might force Docker to emulate x86:

```auto
docker.runOptions = '--platform=linux/amd64'

```
