-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile.runtime
More file actions
57 lines (46 loc) · 2.25 KB
/
Dockerfile.runtime
File metadata and controls
57 lines (46 loc) · 2.25 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
# Stage 3: Minimal runtime image
# Production-ready image with binaries only
ARG BUILDER_IMAGE=qlean-mini-builder:latest
ARG BASE_IMAGE=ubuntu:24.04
FROM ${BUILDER_IMAGE} AS builder
FROM ${BASE_IMAGE} AS runtime
ARG BASE_IMAGE
ARG GIT_COMMIT=unknown
ARG GIT_BRANCH=unknown
ARG BUILD_DATE=unknown
ARG VERSION=unknown
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libstdc++6 \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
ENV LD_LIBRARY_PATH=/opt/qlean/lib:/opt/qlean/vcpkg:/usr/local/lib
ENV QLEAN_MODULES_DIR=/opt/qlean/modules
WORKDIR /work
# Copy artifacts from builder (binaries are already stripped)
COPY --from=builder /opt/artifacts/bin/qlean /usr/local/bin/qlean
COPY --from=builder /opt/artifacts/lib/ /opt/qlean/lib/
COPY --from=builder /opt/artifacts/modules/ /opt/qlean/modules/
COPY --from=builder /opt/artifacts/vcpkg/ /opt/qlean/vcpkg/
# Verify runtime image
RUN echo "=== Runtime image contents ===" && \
echo "Binary:" && ls -lh /usr/local/bin/qlean && \
echo "" && echo "Project libraries:" && ls -lh /opt/qlean/lib/ 2>/dev/null || echo " (none)" && \
echo "" && echo "Modules:" && ls -lh /opt/qlean/modules/ 2>/dev/null || echo " (none)" && \
echo "" && echo "Vcpkg libraries:" && ls /opt/qlean/vcpkg/ | wc -l && echo " files" && \
echo "" && echo "Total image libraries:" && find /opt/qlean -name "*.so*" | wc -l && echo " .so files"
# OCI Image Spec annotations
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL org.opencontainers.image.title="qlean-mini"
LABEL org.opencontainers.image.description="Qlean-mini: lean Ethereum consensus client for devnets — minimal optimized runtime"
LABEL org.opencontainers.image.source="https://github.com/qdrvm/qlean-mini"
LABEL org.opencontainers.image.documentation="https://github.com/qdrvm/qlean-mini#readme"
LABEL org.opencontainers.image.vendor="QDRVM"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.version=$VERSION
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.revision=$GIT_COMMIT
LABEL org.opencontainers.image.ref.name=$GIT_BRANCH
LABEL org.opencontainers.image.base.name=$BASE_IMAGE
ENTRYPOINT ["qlean", "--modules-dir", "/opt/qlean/modules"]
CMD ["--help"]