From d1b5fc15eb931333377e3d76c4bffac2525b7769 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 29 Apr 2024 10:23:13 +0800 Subject: [PATCH] chore: jdk17_ffmpeg_nvidia --- .../workflows/build_jdk17_ffmpeg_nvidia.yml | 32 +++++++++++++++++++ docker/nvidia/Dockerfile | 13 ++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/build_jdk17_ffmpeg_nvidia.yml create mode 100644 docker/nvidia/Dockerfile diff --git a/.github/workflows/build_jdk17_ffmpeg_nvidia.yml b/.github/workflows/build_jdk17_ffmpeg_nvidia.yml new file mode 100644 index 00000000..07afaa27 --- /dev/null +++ b/.github/workflows/build_jdk17_ffmpeg_nvidia.yml @@ -0,0 +1,32 @@ +name: Build and Push Multi-Platform Docker Image + +on: + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: docker/nvidia + file: docker/nvidia/Dockerfile + push: true + tags: jmal/jdk17_ffmpeg_nvidia:latest + platforms: linux/amd64,linux/arm64 + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/docker/nvidia/Dockerfile b/docker/nvidia/Dockerfile new file mode 100644 index 00000000..3e62f1e4 --- /dev/null +++ b/docker/nvidia/Dockerfile @@ -0,0 +1,13 @@ +FROM eclipse-temurin:17-jre + +# 安装 FFmpeg +RUN apt-get update && \ + apt-get install -y software-properties-common && \ + add-apt-repository ppa:jonathonf/ffmpeg-5 && \ + apt-get update && \ + apt-get install -y ffmpeg libavcodec-extra + +# 环境变量 +ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility +ENV NVIDIA_VISIBLE_DEVICES=all