title: Having problems deploying an go app to docker
body: <p>Hi I am pretty new to go, and this is my first time working with docker to package an app into a container. I am working on a linux VM where the app is located under dir: /home/core/app/app-name In the dir app-name there is the main.go program and the Dockerfile. The Dockerfile contains this:</p>
  
  <pre><code>FROM golang:latest
  RUN mkdir /app
  ADD . /home/core/app/app-name
  WORKDIR /app/app-name
  RUN go build -o main .
  CMD ["/app/main"]
  EXPOSE 8080
  </code></pre>
  
  <p>I have tried running from dir /home/core/app/app-name: </p>
  
  <pre><code>docker build -t app-image .
  </code></pre>
  
  <p>But I got this error:</p>
  
  <p>can't load package: package .: no buildable Go source files in /app/stars-app
  The command '/bin/sh -c go build -o main .' returned a non-zero code: 1</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Edit:</strong>
  I got was able to build the image on my windows machine with the Dockfile:</p>
  
  <pre><code>FROM golang:latest
  Add . /app/app-name
  EXPOSE 8080
  CMD ["/app/app-name/main"]
  </code></pre>
  
  <p>And by running: </p>
  
  <pre><code>docker build -t star-image .
  </code></pre>
  
  <p>I can see the image when I run "docker images", but when I try to run it using:</p>
  
  <pre><code>docker run -p 3000:8080 --name goapp --rm app-name
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>docker: Error response from daemon: Container command '/app/app-name/main' not found or does not exist..
  </code></pre>