From 284431067890e99d1a3b55cc69295601b9e98bce Mon Sep 17 00:00:00 2001 From: Lan Tian Date: Tue, 8 Jan 2019 14:54:42 +0800 Subject: [PATCH] Try to fix travis again, add UPX compression --- .travis.yml | 18 ++++++++++-------- frontend/Dockerfile | 2 +- proxy/Dockerfile | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd0b2ab..5399eaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,18 +5,19 @@ language: go go: - "1.10" env: - - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=i386 + # - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=i386 - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=amd64 - - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm32v7 - - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm64v8 - - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=i386 - - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=amd64 - - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm32v7 - - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm64v8 + # - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm32v7 + # - PROGRAM=frontend IMAGE_NAME=bird-lg-go IMAGE_ARCH=arm64v8 + # - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=i386 + # - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=amd64 + # - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm32v7 + # - PROGRAM=proxy IMAGE_NAME=bird-lgproxy-go IMAGE_ARCH=arm64v8 install: - docker run --rm --privileged multiarch/qemu-user-static:register --reset - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - apt-get install -y upx script: - | @@ -35,6 +36,7 @@ script: # Build Go binary mkdir build GOOS=linux GOARCH=$IMAGE_ARCH_GO go build -ldflags="-s -w" -o build/$PROGRAM $PROGRAM/*.go + upx --best build/$PROGRAM # Build image docker build \ @@ -43,7 +45,7 @@ script: --build-arg IMAGE_ARCH=$IMAGE_ARCH \ --build-arg IMAGE_ARCH_ALT=$IMAGE_ARCH_ALT \ --build-arg IMAGE_ARCH_GO=$IMAGE_ARCH_GO \ - $IMAGE_NAME + . # Tag image :{arch} and :{arch}-build{build number} docker tag $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH $DOCKER_USERNAME/$IMAGE_NAME:$IMAGE_ARCH-build$TRAVIS_BUILD_NUMBER diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f0e7e2b..4f199df 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -3,4 +3,4 @@ FROM multiarch/alpine:${THIS_ARCH_ALT}-edge LABEL Lan Tian "lantian@lantian.pub" COPY build/frontend / -ENTRYPOINT ["/frontend"] +ENTRYPOINT ["/lib/ld-musl-x86_64.so.1 /frontend"] diff --git a/proxy/Dockerfile b/proxy/Dockerfile index c0c04de..9f238c9 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -3,4 +3,4 @@ FROM multiarch/alpine:${THIS_ARCH_ALT}-edge LABEL Lan Tian "lantian@lantian.pub" COPY build/proxy / -ENTRYPOINT ["/proxy"] +ENTRYPOINT ["/lib/ld-musl-x86_64.so.1 /proxy"]