Skip to content

Commit

Permalink
feature: Support for build ARM chaosblade-tool images
Browse files Browse the repository at this point in the history
Signed-off-by: tiny.x <[email protected]>
  • Loading branch information
tiny-x authored and xcaspar committed Nov 16, 2020
1 parent c974408 commit dabb707
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ BUILD_TARGET_YAML=$(BUILD_TARGET_PKG_DIR)/yaml
BUILD_TARGET_TAR_NAME=$(BUILD_TARGET_DIR_NAME).tar.gz
BUILD_TARGET_PKG_FILE_PATH=$(BUILD_TARGET)/$(BUILD_TARGET_TAR_NAME)
BUILD_IMAGE_PATH=build/image/blade
BUILD_ARM_IMAGE_PATH=build/image/blade_arm
# cache downloaded file
BUILD_TARGET_CACHE=$(BUILD_TARGET)/cache

Expand Down Expand Up @@ -188,6 +189,16 @@ build_image: ## Build chaosblade-tool image
$(BUILD_IMAGE_PATH)
rm -rf $(BUILD_IMAGE_PATH)/$(BUILD_TARGET_DIR_NAME)

build_image_arm: ## Build chaosblade-tool-arm image
rm -rf $(BUILD_ARM_IMAGE_PATH)/$(BUILD_TARGET_DIR_NAME)
cp -R $(BUILD_TARGET_PKG_NAME) $(BUILD_ARM_IMAGE_PATH)
tar zxvf $(BUILD_TARGET_PKG_NAME) -C $(BUILD_ARM_IMAGE_PATH)
docker build -f $(BUILD_ARM_IMAGE_PATH)/Dockerfile \
--build-arg BLADE_VERSION=$(BLADE_VERSION) \
-t chaosblade-tool-arm:$(BLADE_VERSION) \
$(BUILD_ARM_IMAGE_PATH)
rm -rf $(BUILD_ARM_IMAGE_PATH)/$(BUILD_TARGET_DIR_NAME)

# build docker image with multi-stage builds
docker_image: clean ## Build chaosblade image
docker build -f ./Dockerfile \
Expand Down
18 changes: 18 additions & 0 deletions build/image/blade_arm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM multiarch/alpine:arm64-edge
LABEL maintainer="Changjun Xiao"

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

# The image is chaosblade image
RUN apk --no-cache add --update iproute2 bash util-linux curl fuse coreutils \
&& mkdir -p /lib/modules/$(uname -r)

ARG BLADE_VERSION=0.0.1

ENV CHAOSBLADE_HOME /opt/chaosblade
WORKDIR ${CHAOSBLADE_HOME}

COPY chaosblade-${BLADE_VERSION} ${CHAOSBLADE_HOME}

ENV PATH ${CHAOSBLADE_HOME}:${PATH}
CMD ["sh", "-c", "tail -f /dev/null"]

0 comments on commit dabb707

Please sign in to comment.