服务器监控工具Ward容器化部署【适合监控单台服务器】

一个基于OSHI开发的适用于单服务器的JAVA项目
项目地址:https://github.com/Rudolf-Barbu/Ward

Ward_01

git clone https://github.com/B-Software/Ward.git
cd Ward
docker build . --tag ward

docker run -d --name ward -p 4000:4000 \
-p 自定义端口号:自定义端口号 \
--privileged=true \
--restart always \
ward:latest
#由于目前最新的主线分支v1.8.8已将Dockerfile文件移除,需手动在目录内配置Dockerfile
#该文件来自以前版本

# Base image with maven installed already
FROM maven:3.6.3-jdk-8 as builder

# Copy whole project inside docker
COPY . .

# Build project
RUN mvn clean package

# Base image containing OpenJDK 8, maintained by RedHat
FROM openjdk:8-jre-alpine

# Update apt repo and install sudo package
RUN apk update && \
    apk add --no-cache dmidecode eudev && \
    rm -rf /var/cache/apk/*

# Copy jar and pom from builder image to working directory
COPY --from=builder target/*.jar /ward.jar
COPY --from=builder pom.xml /pom.xml

EXPOSE 4000

# Run jar as sudo user on entry point
ENTRYPOINT java -jar ward.jar

已发布

分类

作者:

标签

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注