title: Docker COPY error when copying files from host to container
body: <p>In the following Dockerfile I'm trying to copy a jar file from a location on the host into the container, but seems Docker does not like it as I guess I'm missing something. Here is my Dockerfile:</p>
  
  <pre><code>FROM anapsix/alpine-java:jdk8
  MAINTAINER joesan
  
  ENV SBT_VERSION 0.13.15
  ENV CHECKSUM 18b106d09b2874f2a538c6e1f6b20c565885b2a8051428bd6d630fb92c1c0f96
  
  ENV APP_NAME my-app
  ENV PROJECT_HOME /opt/apps
  
  RUN mkdir -p $PROJECT_HOME/$APP_NAME
  
  # Copy the jar file
  COPY ./target/scala-*/my-app-*.jar $PROJECT_HOME/$APP_NAME
  
  # Copy the database file
  COPY .my-db.mv.db $PROJECT_HOME/$APP_NAME
  
  # Run the application
  CMD ["$PROJECT_HOME/$APP_NAME java -Denv=dev -jar my-app-*.jar"]
  </code></pre>
  
  <p>In my build pipeline, I could see the following error message:</p>
  
  <pre><code>Step 8/10 : COPY ./target/scala-*/my-app-*.jar $PROJECT_HOME/$APP_NAME
  COPY failed: no source files were specified
  REPOSITORY            TAG                 IMAGE ID            CREATED                  SIZE
  &lt;none&gt;                &lt;none&gt;              4a240742a379        Less than a second ago   171MB
  anapsix/alpine-java   jdk8                ed55c27d366d        3 years ago              171MB
  Error response from daemon: No such image: [secure]
  Pushing image [secure] to repository hub.docker.com
  The push refers to repository [docker.io/[secure]/my-app]
  An image does not exist locally with the tag: [secure]/my-app
  </code></pre>
  
  <p>What is that I'm missing and how could I debug this? I mean I could add some echo statements to print out the path, but I'm not sure why I face this error!</p>