-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (50 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
66 lines (50 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# SentinelEdge Production Docker Image
FROM ubuntu:22.04
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
clang \
llvm \
libclang-dev \
linux-headers-generic \
pkg-config \
libssl-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Set working directory
WORKDIR /app
# Copy project files
COPY Cargo.toml Cargo.lock ./
COPY kernel-agent/ ./kernel-agent/
COPY user-agent/ ./user-agent/
# Build the project
RUN cargo build --release
# Runtime stage
FROM ubuntu:22.04
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Create sentinel user
RUN useradd -r -s /bin/false sentinel
# Copy binary
COPY --from=0 /app/target/release/sentinel-edge /usr/local/bin/
RUN chmod +x /usr/local/bin/sentinel-edge
# Create directories
RUN mkdir -p /etc/sentinel-edge /var/log/sentinel-edge
RUN chown -R sentinel:sentinel /var/log/sentinel-edge
# Copy default config
COPY examples/config_examples/production.toml /etc/sentinel-edge/config.toml
# Expose ports
EXPOSE 8080 8443
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Run as non-root user (except for eBPF loading which needs privileges)
USER root
# Default command
CMD ["/usr/local/bin/sentinel-edge", "--config", "/etc/sentinel-edge/config.toml"]