Skip to content

Commit

Permalink
ci:test arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
samwafgo committed Nov 18, 2024
1 parent 4c0a471 commit ac4d2bf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ RUN apk update && \

# 复制适用架构的二进制文件到镜像
ARG TARGETARCH
ENV BINARY_PATH=""
RUN echo "Building for architecture: ${TARGETARCH}"
# 使用RUN指令和if语句根据架构选择文件
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
export BINARY_PATH="dist/samwaf_linux_linux_amd64_v1/SamWafLinux64"; \
cp dist/samwaf_linux_linux_amd64_v1/SamWafLinux64 ./SamWafLinux64; \
elif [ "${TARGETARCH}" = "arm64" ]; then \
export BINARY_PATH="dist/samwaf_linux_arm64_linux_arm64_v8.0/SamWafLinuxArm64"; \
cp dist/samwaf_linux_arm64_linux_arm64/SamWafLinuxArm64 ./SamWafLinux64; \
else \
echo "Unknown architecture: ${TARGETARCH}" && exit 1; \
fi

# 复制文件到镜像中
COPY ${BINARY_PATH} ./SamWafLinux64


# 设置执行权限
RUN chmod +x SamWafLinux64

Expand Down

0 comments on commit ac4d2bf

Please sign in to comment.