Skip to content

Commit

Permalink
Compile statically so the binary can work in alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxenceAdnot committed Nov 15, 2017
1 parent 4d21aaf commit 2d6ddc6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/kairos_remote_adapter
build/bin/
out/
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM alpine:latest

ADD out/adapter /usr/bin/
ADD out/adapter_linux_amd64 /usr/bin/adapter

RUN chmod +x /usr/bin/adapter

ADD launch.sh ./launch

EXPOSE 8080
CMD ./launch
2 changes: 1 addition & 1 deletion bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ echo -e "\nGenerating Binary..."

CURRENTDIR=`pwd`

go build -o $CURRENTDIR/out/adapter
CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o $CURRENTDIR/out/adapter
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ listen_addr: 127.0.0.1
log_level: debug
log_json: false
no_color: false
worker: 5
workers: 5
2 changes: 1 addition & 1 deletion launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
cat << EOF > config.yml
kairos_url: ${KAIROS}
skip_insecure: ${SKIP_INSECURE:-false}
listen_addr: 0.0.0.0:8080
listen_addr: ${LISTEN_ADDR:-0.0.0.0:8080}
log_level: ${LOG_LEVEL:-info}
log_json: ${LOG_JSON:-true}
no_color: ${NO_COLOR:-false}
Expand Down

0 comments on commit 2d6ddc6

Please sign in to comment.