diff --git a/.drone.yml b/.drone.yml index b629023..6094371 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,19 +31,19 @@ pipeline: - make misspell-check - make fmt-check - build: + build_linux_amd64: image: appleboy/golang-testing:1.9 group: golang commands: - make docker_build - arm64: + build_linux_arm64: image: appleboy/golang-testing:1.9 group: golang commands: - make docker_build_arm64 - arm: + build_linux_arm: image: appleboy/golang-testing:1.9 group: golang commands: @@ -63,7 +63,6 @@ pipeline: - .cover/coverage.txt when: event: [ push, pull_request ] - status: [ success ] release: image: appleboy/golang-testing:1.9 @@ -88,24 +87,24 @@ pipeline: branch: [ master ] local: false - publish_linux_armhf: + publish_linux_arm: image: plugins/docker group: publish repo: ${DRONE_REPO} - tags: [ 'linux-arm' ] - dockerfile: Dockerfile.armhf + tags: [ linux-arm ] + dockerfile: Dockerfile.arm secrets: [ docker_username, docker_password ] when: event: [ push ] branch: [ master ] local: false - publish_linux_aarch64: + publish_linux_arm64: image: plugins/docker group: publish repo: ${DRONE_REPO} - tags: [ 'linux-arm64' ] - dockerfile: Dockerfile.aarch64 + tags: [ linux-arm64 ] + dockerfile: Dockerfile.arm64 secrets: [ docker_username, docker_password ] when: event: [ push ] @@ -124,32 +123,6 @@ pipeline: branch: [ refs/tags/* ] local: false - publish_tag_linux_armhf: - image: plugins/docker - group: tag - repo: ${DRONE_REPO} - tags: [ '${DRONE_TAG}-linux-arm' ] - dockerfile: Dockerfile.armhf - secrets: [ docker_username, docker_password ] - group: release - when: - event: [ tag ] - branch: [ refs/tags/* ] - local: false - - publish_tag_linux_aarch64: - image: plugins/docker - group: tag - repo: ${DRONE_REPO} - tags: [ '${DRONE_TAG}-linux-arm64' ] - dockerfile: Dockerfile.aarch64 - secrets: [ docker_username, docker_password ] - group: release - when: - event: [ tag ] - branch: [ refs/tags/* ] - local: false - release_tag: image: plugins/github-release secrets: [ github_release_api_key ] diff --git a/Dockerfile b/Dockerfile index 0889f97..799fb85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,22 @@ -FROM centurylink/ca-certs -EXPOSE 8088 +FROM alpine:3.6 as alpine +RUN apk add -U --no-cache ca-certificates + +FROM scratch +MAINTAINER Bo-Yi Wi + +ENV GODEBUG=netdns=go + +COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +LABEL org.label-schema.version=latest +LABEL org.label-schema.vcs-url="https://github.com/appleboy/gorush.git" +LABEL org.label-schema.name="Gorush" +LABEL org.label-schema.vendor="Bo-Yi Wu" +LABEL org.label-schema.schema-version="1.0" ADD config/config.yml / ADD bin/gorush / +EXPOSE 8088 ENTRYPOINT ["/gorush"] CMD ["-c", "config.yml"] diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 deleted file mode 100644 index 73a2a10..0000000 --- a/Dockerfile.aarch64 +++ /dev/null @@ -1,10 +0,0 @@ -FROM centurylink/ca-certs -ENV GODEBUG=netdns=go - -EXPOSE 8088 - -ADD config/config.yml / -ADD bin/gorush-arm64 /gorush - -ENTRYPOINT ["/gorush"] -CMD ["-c", "config.yml"] diff --git a/Dockerfile.arm b/Dockerfile.arm new file mode 100644 index 0000000..894e78b --- /dev/null +++ b/Dockerfile.arm @@ -0,0 +1,22 @@ +FROM alpine:3.6 as alpine +RUN apk add -U --no-cache ca-certificates + +FROM scratch +MAINTAINER Bo-Yi Wi + +ENV GODEBUG=netdns=go + +COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +LABEL org.label-schema.version=latest +LABEL org.label-schema.vcs-url="https://github.com/appleboy/gorush.git" +LABEL org.label-schema.name="Gorush" +LABEL org.label-schema.vendor="Bo-Yi Wu" +LABEL org.label-schema.schema-version="1.0" + +ADD config/config.yml / +ADD bin/gorush-arm /gorush + +EXPOSE 8088 +ENTRYPOINT ["/gorush"] +CMD ["-c", "config.yml"] diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 new file mode 100644 index 0000000..8157b6a --- /dev/null +++ b/Dockerfile.arm64 @@ -0,0 +1,22 @@ +FROM alpine:3.6 as alpine +RUN apk add -U --no-cache ca-certificates + +FROM scratch +MAINTAINER Bo-Yi Wi + +ENV GODEBUG=netdns=go + +COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +LABEL org.label-schema.version=latest +LABEL org.label-schema.vcs-url="https://github.com/appleboy/gorush.git" +LABEL org.label-schema.name="Gorush" +LABEL org.label-schema.vendor="Bo-Yi Wu" +LABEL org.label-schema.schema-version="1.0" + +ADD config/config.yml / +ADD bin/gorush-arm64 /gorush + +EXPOSE 8088 +ENTRYPOINT ["/gorush"] +CMD ["-c", "config.yml"] diff --git a/Dockerfile.armhf b/Dockerfile.armhf deleted file mode 100644 index dcb854f..0000000 --- a/Dockerfile.armhf +++ /dev/null @@ -1,10 +0,0 @@ -FROM centurylink/ca-certs -ENV GODEBUG=netdns=go - -EXPOSE 8088 - -ADD config/config.yml / -ADD bin/gorush-arm /gorush - -ENTRYPOINT ["/gorush"] -CMD ["-c", "config.yml"] diff --git a/Makefile b/Makefile index 715a440..86ab4b7 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,7 @@ docker_build: docker_build_arm64: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GO) build -a -tags '$(TAGS)' -ldflags "$(EXTLDFLAGS)-s -w $(LDFLAGS)" -o bin/$(EXECUTABLE)-arm64 + docker_build_arm: CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 $(GO) build -a -tags '$(TAGS)' -ldflags "$(EXTLDFLAGS)-s -w $(LDFLAGS)" -o bin/$(EXECUTABLE)-arm