1 Star 0 Fork 3

simazilin/chaosblade

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
Daniel Sutton 提交于 2020-03-06 16:06 . Updated Golang to 1.14.0
FROM golang:1.14.0 AS builder
LABEL maintainer="Changjun Xiao, Ming Cheng"
ARG BLADE_VERSION=0.0.1
ARG MUSL_VERSION=1.2.0
# Using 163 mirror for Debian Strech
RUN sed -i 's/deb.debian.org/mirrors.163.com/g' /etc/apt/sources.list
RUN apt-get update && apt-get install unzip
# # The image is used to build chaosblade for musl
RUN wget http://www.musl-libc.org/releases/musl-${MUSL_VERSION}.tar.gz \
&& tar -zxvf musl-${MUSL_VERSION}.tar.gz \
&& rm musl-${MUSL_VERSION}.tar.gz \
&& cd musl* \
&& ./configure \
&& make \
&& make install \
&& rm -rf musl*
ENV CC /usr/local/musl/bin/musl-gcc
ENV GOOS linux
ENV BLADE_BUILD_PATH /tmp/chaosblade
# Print go version
RUN ${CC} --version
RUN go version
# Build blade
COPY . ${BLADE_BUILD_PATH}
WORKDIR ${BLADE_BUILD_PATH}
RUN make clean && \
go mod vendor && \
env GO111MODULE=on GO15VENDOREXPERIMENT=1 make && \
mv -f ${BLADE_BUILD_PATH}/target/chaosblade-${BLADE_VERSION} /usr/local/chaosblade
# Stage2
FROM alpine:3.10.4
# @from https://mirrors.ustc.edu.cn/help/alpine.html
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
# Install necessary package.
RUN apk --no-cache add --update iproute2 bash util-linux curl \
&& mkdir -p /lib/modules/$(uname -r)
ENV CHAOSBLADE_HOME /usr/local/chaosblade
COPY --from=builder ${CHAOSBLADE_HOME} ${CHAOSBLADE_HOME}
WORKDIR ${CHAOSBLADE_HOME}
ENV PATH ${CHAOSBLADE_HOME}:${PATH}
CMD ["blade"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/simazilin_cn/chaosblade.git
git@gitee.com:simazilin_cn/chaosblade.git
simazilin_cn
chaosblade
chaosblade
master

搜索帮助