From ded50df8b8e51bdfeeb3d3a891c2270d44c89307 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sat, 17 Feb 2018 01:14:43 +0300 Subject: [PATCH 1/2] Build chrly statically to work with Alpine image --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2ec65ad..b2bc673 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ jobs: env GOOS=linux GOARCH=amd64 go build -o release/chrly - -ldflags "-X github.com/elyby/chrly/bootstrap.version=$APP_VERSION" + -ldflags '-extldflags "-static" -X github.com/elyby/chrly/bootstrap.version=$APP_VERSION' main.go - docker build -t elyby/chrly:$DOCKER_TAG . - docker push elyby/chrly:$DOCKER_TAG From 2cd97dda8b7581cd24e7d0353b5598be5237ed52 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sat, 17 Feb 2018 01:25:24 +0300 Subject: [PATCH 2/2] Compile without CGO usage --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b2bc673..d6fcf63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ jobs: - export DOCKER_TAG="${TRAVIS_TAG:-dev}" - export APP_VERSION="${TRAVIS_TAG:-dev-${TRAVIS_COMMIT:0:7}}" - > - env GOOS=linux GOARCH=amd64 + env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o release/chrly -ldflags '-extldflags "-static" -X github.com/elyby/chrly/bootstrap.version=$APP_VERSION'