Note the code works perfectly fine when I'm running the code on my laptop.
The following two groups of code will run on my laptop. However the second group (which uses my custom package) doesn't work on Elastic Beanstalk running docker.
Standard Lib only
import (
"net/http"
"os"
)
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "3000"
}
http.ListenAndServe(":"+port, nil)
}
Uses Custom Package
import (
"os"
"github.com/sim/handlers"
)
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "3000"
}
handlers.ServeAndHandle(port) // wrapper of ListenAndServe
}
Error Messages:
Failed to build Docker image aws_beanstalk/staging-app: andlers: exit status 128 [0mtime="2015-08-14T05:08:17Z" level="info" msg="The command [/bin/sh -c go-wrapper download] returned a non-zero code: 1" . Check snapshot logs for details.
2015-08-14 01:08:15 UTC-0400 WARN Failed to build Docker image aws_beanstalk/staging-app, retrying...
cron.yaml
version: 1
cron:
- name: "task1"
url: "/scheduled"
schedule: "* * * * *"