Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinguang Wang committed Apr 26, 2019
1 parent 4e1e6af commit aa6f885
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ GOOS=linux GOARCH=amd64 go build -o main main.go
zip main.zip main
```

**(docker)Golang Alpine images** doesn't build statically linked binary:
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, stripped

The interpreter doesn't exist in Lambda environment so that's will throws "no such file or directory error".

To solve that use
``` shell
GOOS=linux go build -v -ldflags '-d -s -w' -a -tags netgo -installsuffix netgo -o bin/service service/main.go
```


## For developers on Windows

Windows developers may have trouble producing a zip file that marks the binary as executable on Linux. To create a .zip that will work on AWS Lambda, the `build-lambda-zip` tool may be helpful.
Expand Down

0 comments on commit aa6f885

Please sign in to comment.