Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support arm64 and arm docker image. #277

Merged
merged 2 commits into from
Aug 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 66 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ pipeline:
commands:
- make docker_build

arm64:
image: appleboy/golang-testing
group: golang
commands:
- make docker_build_arm64

arm:
image: appleboy/golang-testing
group: golang
commands:
- make docker_build_arm

coverage:
image: appleboy/golang-testing
group: golang
Expand Down Expand Up @@ -65,9 +77,9 @@ pipeline:
event: [ tag ]
branch: [ refs/tags/* ]

publish_latest:
publish_linux_amd64:
image: plugins/docker
pull: true
group: publish
repo: ${DRONE_REPO}
tags: [ 'latest' ]
secrets: [ docker_username, docker_password ]
Expand All @@ -76,9 +88,33 @@ pipeline:
branch: [ master ]
local: false

publish_tag:
publish_linux_armhf:
image: plugins/docker
pull: true
group: publish
repo: ${DRONE_REPO}
tags: [ 'linux-arm' ]
dockerfile: Dockerfile.armhf
secrets: [ docker_username, docker_password ]
when:
event: [ push ]
branch: [ master ]
local: false

publish_linux_aarch64:
image: plugins/docker
group: publish
repo: ${DRONE_REPO}
tags: [ 'linux-arm64' ]
dockerfile: Dockerfile.aarch64
secrets: [ docker_username, docker_password ]
when:
event: [ push ]
branch: [ master ]
local: false

publish_tag_linux_amd64:
image: plugins/docker
group: tag
repo: ${DRONE_REPO}
tags: [ '${DRONE_TAG}' ]
secrets: [ docker_username, docker_password ]
Expand All @@ -88,6 +124,32 @@ 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 ]
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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"]
10 changes: 10 additions & 0 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ release-check:
docker_build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -a -tags '$(TAGS)' -ldflags "$(EXTLDFLAGS)-s -w $(LDFLAGS)" -o bin/$(EXECUTABLE)

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

docker_image:
docker build -t $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE) -f Dockerfile .

Expand Down