Dockerfile
FROM ubuntu AS builder
MAINTAINER [email protected]
WORKDIR /root
RUN apt -y update \
&& apt -y install curl build-essential \
&& curl -L http://www.devin.com/lookbusy/download/lookbusy-1.4.tar.gz -o lookbusy-1.4.tar.gz \
&& tar -xzvf lookbusy-1.4.tar.gz \
&& cd lookbusy-1.4/ \
&& ./configure \
&& make \
&& make install \
&& chmod +x /usr/local/bin/lookbusy
FROM ubuntu
COPY --from=builder /usr/local/bin/lookbusy /usr/local/bin/lookbusy
ENTRYPOINT ["/usr/local/bin/lookbusy","-c","20","-m","5"]
参数-c指cpu使用率,-m指内存使用率。可以根据自己的实例配置来适当配置。
docker build -t hqhyco/busy .
docker run -d --name busy hqhyco/busy