title: Dockerfile cannot run a container using "docker-compose-up --build" command
body: <p>Dockerfile cannot run a container using &quot;docker-compose-up --build&quot; command</p>
  <p>When I run Dockerfile using the &quot;docker-compose up --build&quot; command, the file not found is output, and the container is not running.</p>
  <p>Dockerfile, docker-compose.yaml, directory and result is below.</p>
  <p>Docker version :</p>
  <pre><code>\server&gt;docker --version
  Docker version 20.10.14, build a224086
  </code></pre>
  <p>Dockerfile :</p>
  <pre><code>FROM openjdk:14-jdk-alpine3.10
  
  RUN mkdir -p /app/workspace/config &amp;&amp; \
      mkdir -p /app/workspace/lib &amp;&amp; \
      mkdir -p /app/workspace/bin
  
  WORKDIR /app/workspace
  VOLUME /app/workspace
  
  COPY ./bin ./bin
  COPY ./config ./config
  COPY ./lib ./lib
  
  RUN chmod 774 /app/workspace/bin/*.sh
  
  EXPOSE 6969
  
  WORKDIR /app/workspace/bin
  
  ENTRYPOINT ./startServer.sh
  </code></pre>
  <p>docker-compose.yaml:</p>
  <pre><code>version: '3'
  
  services:
    server:
      container_name: cn-server
      build:
        context: ./server/
        dockerfile: Dockerfile
      ports:
        - &quot;6969:6969&quot;
      volumes:
        - ${SERVER_HOST_DIR}:/app/workspace
      networks:
        - backend
  
  networks:
      backend:
          driver: bridge
  </code></pre>
  <p>directories :
  <a href="https://i.stack.imgur.com/Gmlxk.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>&quot;docker-compose up --build&quot; command execution result :</p>
  <pre><code>Building server
  [+] Building 3.7s (13/13) FINISHED
   =&gt; [internal] load build definition from Dockerfile                                                                                                                                                                               0.0s 
   =&gt; =&gt; transferring dockerfile: 425B                                                                                                                                                                                               0.0s 
   =&gt; [internal] load .dockerignore                                                                                                                                                                                                  0.0s 
   =&gt; =&gt; transferring context: 2B                                                                                                                                                                                                    0.0s 
   =&gt; [internal] load metadata for docker.io/library/openjdk:14-jdk-alpine3.10                                                                                                                                                       2.0s 
   =&gt; [internal] load build context                                                                                                                                                                                                  0.0s 
   =&gt; =&gt; transferring context: 239B                                                                                                                                                                                                  0.0s 
   =&gt; CACHED [1/8] FROM docker.io/library/openjdk:14-jdk-alpine3.10@sha256:b8082268ef46d44ec70fd5a64c71d445492941813ba9d68049be6e63a0da542f                                                                                          0.0s 
   =&gt; [2/8] RUN mkdir -p /app/workspace/config &amp;&amp;     mkdir -p /app/workspace/lib &amp;&amp;     mkdir -p /app/workspace/bin                                                                                                                 0.4s 
   =&gt; [3/8] WORKDIR /app/workspace                                                                                                                                                                                                   0.1s 
   =&gt; [4/8] COPY ./bin ./bin                                                                                                                                                                                                         0.1s 
   =&gt; [5/8] COPY ./config ./config                                                                                                                                                                                                   0.1s 
   =&gt; [6/8] COPY ./lib ./lib                                                                                                                                                                                                         0.1s 
   =&gt; [7/8] RUN chmod 774 /app/workspace/bin/*.sh                                                                                                                                                                                    0.5s 
   =&gt; [8/8] WORKDIR /app/workspace/bin                                                                                                                                                                                               0.1s 
   =&gt; exporting to image                                                                                                                                                                                                             0.2s 
   =&gt; =&gt; exporting layers                                                                                                                                                                                                            0.2s 
   =&gt; =&gt; writing image sha256:984554c9d7d9b3312fbe2dc76b4c7381e93cebca3a808ca16bd9e3777d42f919                                                                                                                                       0.0s 
   =&gt; =&gt; naming to docker.io/library/docker_cn-server                                                                                                                                                                               0.0s 
  Creating cn-server ... done
  Attaching to cn-server
  cn-server        | /bin/sh: ./startServer.sh: not found
  cn-server exited with code 127
  </code></pre>
  <p>Also bin, config, lib directories are not created in host volume directory and no files.</p>
  <p>Please tell me what I was wrong or what I used wrong.</p>
  <p>Thank you.</p>