-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ident * add build artifacts to gitignore * Add upx to shrink binary
- Loading branch information
Showing
6 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* ident |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ Session.vim | |
*~ | ||
# auto-generated tag files | ||
tags | ||
|
||
# build artifacts | ||
hello_world | ||
docker-hello-world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,9 @@ go: | |
- 1.8 | ||
- 1.9 | ||
- master | ||
addons: | ||
apt: | ||
packages: | ||
- upx | ||
script: | ||
- make all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,12 @@ | |
FROM golang:1.9.2 AS builder | ||
WORKDIR /go/src/github.com/infrastructure-as-code/docker-hello-world | ||
ENV GIN_MODE debug | ||
ENV DEBIAN_FRONTEND noninteractive | ||
COPY Makefile *.go ./ | ||
RUN make all | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y upx && \ | ||
make all | ||
|
||
FROM scratch | ||
LABEL maintainer "Vince Tse <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
all: deps test | ||
CGO_ENABLED=0 go build -a -o hello_world | ||
upx --brute hello_world | ||
|
||
test: | ||
GIN_MODE=debug go test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters