Skip to content

Commit

Permalink
[release-1.1]chore(arm64): support building arm64 images (#80)
Browse files Browse the repository at this point in the history
* update vendor

* support building arm64 images
  • Loading branch information
Linjian Jiang authored Mar 4, 2020
1 parent 5d0748c commit d20ac1c
Show file tree
Hide file tree
Showing 211 changed files with 18,650 additions and 128,841 deletions.
118 changes: 30 additions & 88 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

[[constraint]]
name = "github.com/elastic/beats"
version = "6.5.4"
version = "7.6.0"

[[constraint]]
name = "github.com/elastic/go-ucfg"
Expand Down
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,21 @@ TARGETS ?= log-pilot filebeat-keeper
IMAGE_PREFIX ?= $(strip )
IMAGE_SUFFIX ?= $(strip )

# Container registries.
REGISTRY ?= cargo.dev.caicloud.xyz/release

# Container registry for base images.
BASE_REGISTRY ?= cargo.caicloud.xyz/library

# Go build GOARCH, you can choose to build amd64 or arm64
ARCH ?= amd64

# Change Dockerfile name and registry project name for arm64
ifeq ($(ARCH),arm64)
DOCKERFILE := Dockerfile.arm64
REGISTRY ?= cargo.dev.caicloud.xyz/arm64v8
else
DOCKERFILE := Dockerfile
REGISTRY ?= cargo.dev.caicloud.xyz/release
endif

#
# These variables should not need tweaking.
#
Expand Down Expand Up @@ -111,7 +120,7 @@ build-linux:
-v $(PWD):/go/src/$(ROOT) \
-w /go/src/$(ROOT) \
-e GOOS=linux \
-e GOARCH=amd64 \
-e GOARCH=$(ARCH) \
-e GOPATH=/go \
-e SHELLOPTS=$(SHELLOPTS) \
$(BASE_REGISTRY)/golang:1.10.4-stretch \
Expand All @@ -128,7 +137,7 @@ container: build-linux
image=$(IMAGE_PREFIX)$${target}$(IMAGE_SUFFIX); \
docker build -t $(REGISTRY)/$${image}:$(VERSION) \
--label $(DOCKER_LABELS) \
-f $(BUILD_DIR)/$${target}/Dockerfile .; \
-f $(BUILD_DIR)/$${target}/$(DOCKERFILE) .; \
done

push: container
Expand Down
10 changes: 10 additions & 0 deletions build/filebeat-keeper/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM cargo.dev.caicloud.xyz/arm64v8/filebeat:6.8.6

USER root
RUN mkdir /etc/filebeat
COPY build/filebeat-keeper/k8s-log-template.json /etc/filebeat/k8s-log-template.json
COPY build/filebeat-keeper/filebeat.yml.tpl /etc/filebeat/filebeat.yml.tpl
COPY bin/filebeat-keeper /opt/filebeat-keeper/filebeat-keeper

WORKDIR /usr/share/filebeat
CMD ["/opt/filebeat-keeper/filebeat-keeper"]
10 changes: 10 additions & 0 deletions build/filebeat/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM cargo.dev.caicloud.xyz/arm64v8/filebeat:6.8.6

USER root
RUN mkdir /etc/filebeat
COPY build/filebeat/k8s-log-template.json /etc/filebeat/k8s-log-template.json
COPY build/filebeat/filebeat.yml.tpl /etc/filebeat/filebeat.yml.tpl
COPY bin/filebeat-keeper /opt/filebeat-keeper/filebeat-keeper

WORKDIR /usr/share/filebeat
CMD ["/opt/filebeat-keeper/filebeat-keeper"]
7 changes: 7 additions & 0 deletions build/log-pilot/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM cargo.caicloud.xyz/arm64v8/debian:stretch-curl

COPY bin/log-pilot /opt/log-pilot/bin/log-pilot
COPY assets/filebeat/filebeat.tpl /opt/log-pilot

WORKDIR /opt/log-pilot
CMD ["/opt/log-pilot/bin/log-pilot"]
21 changes: 0 additions & 21 deletions vendor/github.com/BurntSushi/toml/COPYING

This file was deleted.

Loading

0 comments on commit d20ac1c

Please sign in to comment.