mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
- Dockerfile: 合并 RUN 层减少镜像层数,使用 COPY --chmod 简化权限设置 - init.sh: 指定数据目录为 /etc/one-kvm 确保路径一致 - package-docker.sh: 从 libs/ventoy-img-rs/resources 复制资源并自动解压 xz 文件 - README.md: 修正 docker run 示例格式
57 lines
1.3 KiB
Docker
57 lines
1.3 KiB
Docker
# One-KVM Runtime Image
|
|
# This Dockerfile only packages pre-compiled binaries (no compilation)
|
|
# Used after cross-compiling with `cross build`
|
|
|
|
ARG TARGETPLATFORM=linux/amd64
|
|
|
|
FROM debian:12-slim
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
# Install runtime dependencies and create directories
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# Runtime libraries
|
|
libasound2 \
|
|
libv4l-0 \
|
|
libudev1 \
|
|
zlib1g \
|
|
libjpeg62-turbo \
|
|
libyuv0 \
|
|
# FFmpeg runtime
|
|
libavcodec59 \
|
|
libavformat59 \
|
|
libavutil57 \
|
|
libswscale6 \
|
|
libswresample4 \
|
|
# Video codecs
|
|
libx264-164 \
|
|
libx265-199 \
|
|
libvpx7 \
|
|
# Audio codec
|
|
libopus0 \
|
|
# Hardware acceleration
|
|
libva2 \
|
|
libva-drm2 \
|
|
libdrm2 \
|
|
# X11 (for VAAPI)
|
|
libx11-6 \
|
|
libxcb1 \
|
|
# Utilities
|
|
ca-certificates \
|
|
# Intel Media SDK (x86_64 only, ignored on other archs)
|
|
$([ "$TARGETPLATFORM" = "linux/amd64" ] && echo "libmfx1") \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& mkdir -p /etc/one-kvm/ventoy
|
|
|
|
# Copy init script
|
|
COPY --chmod=755 init.sh /init.sh
|
|
|
|
# Copy binaries (these are placed by the build script)
|
|
COPY --chmod=755 one-kvm ttyd gostc easytier-core /usr/bin/
|
|
|
|
# Copy ventoy resources if they exist
|
|
COPY ventoy/ /etc/one-kvm/ventoy/
|
|
|
|
# Entrypoint
|
|
CMD ["/init.sh"]
|