-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (55 loc) · 1.97 KB
/
Dockerfile
File metadata and controls
67 lines (55 loc) · 1.97 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
67
# Build stage
FROM arm64v8/ubuntu:24.04 AS builder
# Add metadata
LABEL maintainer="Aman Sikarwar <amansikarwaar@gmail.com>"
LABEL description="Amazon KVS WebRTC SDK for Raspberry Pi"
LABEL version="1.0"
# Prevent interactive prompts during build
ENV DEBIAN_FRONTEND=noninteractive
# Update package lists and install build tools and dependencies
RUN apt-get update && apt-get install -y \
cmake \
m4 \
pkg-config \
libssl-dev \
libcurl4-openssl-dev \
liblog4cplus-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-tools \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Clone the SDK repository using a specific shallow clone for reproducibility
RUN git clone --depth 1 https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c.git \
--single-branch -b main /kvs-webrtc-sdk
# Build SDK
WORKDIR /kvs-webrtc-sdk/build
RUN cmake .. && make -j$(nproc)
# Runtime stage
FROM arm64v8/ubuntu:24.04
# Copy only necessary files from builder
COPY --from=builder /kvs-webrtc-sdk/build/samples /kvs-webrtc-sdk/build/samples
COPY --from=builder /kvs-webrtc-sdk/build/lib /kvs-webrtc-sdk/build/lib
COPY --from=builder /kvs-webrtc-sdk/certs /kvs-webrtc-sdk/certs
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
libssl3 \
libcurl4 \
liblog4cplus-2.0.5 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
&& rm -rf /var/lib/apt/lists/*
# (Optional) Add a HEALTHCHECK to monitor container health
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD curl -f http://localhost/ || exit 1
# Create a non-root user and switch to it for improved security
RUN useradd -ms /bin/bash appuser
USER appuser
WORKDIR /kvs-webrtc-sdk/build
# Set a default command to run the master sample
CMD ["./samples/kvsWebrtcClientMaster"]