title: How to fix "Illegal option" error when compiling a dockerfile?
body: <p>I have an application in <strong>dockerfile</strong> where it is necessary to call a <strong>.sh</strong> file to download packages, but there is always an error when calling this file.</p>
  <p>My dockerfile is:</p>
  <pre class="lang-go prettyprint-override"><code>FROM alpine:3.12 as builder
  
  ARG VERSION=7.16.0
  ARG DISTRO=tomcat
  ARG SNAPSHOT=true
  
  ARG JMX_PROMETHEUS_VERSION=0.12.0
  
  RUN apk add --no-cache \
          bash \
          ca-certificates \
          maven \
          tar \
          wget \
          xmlstarlet
  
  COPY settings.xml download.sh camunda-run.sh camunda-tomcat.sh camunda-wildfly.sh  /tmp/
  
  RUN /tmp/download.sh
  
  FROM alpine:3.12
  
  RUN apk add --no-cache \
          bash \
          ca-certificates \
          curl \
          openjdk11-jre-headless \
          tzdata \
          tini \
          xmlstarlet \
      &amp;&amp; curl -o /usr/local/bin/wait-for-it.sh \
        &quot;https://raw.githubusercontent.com/vishnubob/wait-for-it/a454892f3c2ebbc22bd15e446415b8fcb7c1cfa4/wait-for-it.sh&quot; \
      &amp;&amp; chmod +x /usr/local/bin/wait-for-it.sh
  
  RUN addgroup -g 1000 -S camunda &amp;&amp; \
      adduser -u 1000 -S camunda -G camunda -h /camunda -s /bin/bash -D camunda
  WORKDIR /camunda
  USER camunda
  
  ENTRYPOINT [&quot;/sbin/tini&quot;, &quot;--&quot;]
  CMD [&quot;./camunda.sh&quot;]
  
  COPY --chown=camunda:camunda --from=builder /camunda .
  </code></pre>
  <p>My download.sh file looks exactly like this: <a href="https://github.com/camunda/docker-camunda-bpm-platform/blob/next/download.sh" rel="nofollow noreferrer">https://github.com/camunda/docker-camunda-bpm-platform/blob/next/download.sh</a></p>
  <p>When running the command: <code>docker build . -t servicecamundadocker/latest</code> i get the error:</p>
  <pre><code> =&gt; ERROR [builder 4/4] RUN /tmp/download.sh                                                                                       0.2s ------
   &gt; [builder 4/4] RUN /tmp/download.sh:
  #11 0.216 /bin/sh: illegal option -
  ------
  </code></pre>
  <p><a href="https://i.stack.imgur.com/hC8HW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hC8HW.png" alt="enter image description here" /></a></p>
  <p>Does anyone know how to fix this error? Thanks</p>