From 1f58a7fc5a0d746d9e737a73c7ab538dd5f68e8f Mon Sep 17 00:00:00 2001 From: ale Date: Mon, 4 Nov 2024 00:43:07 +0100 Subject: [PATCH] refactor and .drone.yml --- .drone.yml | 38 ++++++++++++++++++++++++++++++++++++++ README.md | 4 ++++ docker-compose.yml | 18 +++++------------- 3 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4ba7a31 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,38 @@ +kind: pipeline +name: code-build-linux-amd64 +type: docker + +platform: + os: linux + arch: arm64 + +steps: +- name: build + image: docker:dind + privileged: true + environment: + USER: + from_secret: user + PASS: + from_secret: pass + REGISTRY: + from_secret: registry + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + - docker login -u $USER -p $PASS $REGISTRY + - docker run --rm --privileged $REGISTRY/qemu-user-static --reset -p yes + - docker buildx build --platform amd64 -t $REGISTRY/docker-ffmpeg-gpu . + - docker push $REGISTRY/docker-ffmpeg-gpu + - docker tag $REGISTRY/docker-ffmpeg-gpu $REGISTRY/docker-ffmpeg-gpu:amd64 + - docker push $REGISTRY/docker-ffmpeg-gpu:amd64 + when: + event: + - push + - tag + +volumes: +- name: dockersock + host: + path: /var/run/docker.sock diff --git a/README.md b/README.md index f71fde1..be5ee8c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ Use `ffmpeg` with `docker` and `nvidia` powers to transcode in Debian 11 Bullsey $ git clone https://git.manalejandro.com/ale/docker-ffmpeg-gpu $ cd docker-ffmpeg-gpu && docker-compose build --force-rm +## Pull docker image + + $ docker pull registry.manalejandro.com/docker-ffmpeg-gpu + ## Usage ### You can use "/ffmpeg" or "/ffmpeg-pascal" for architecture version diff --git a/docker-compose.yml b/docker-compose.yml index 9bd7e74..7b5b267 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,14 @@ -version: '3' - services: - nvidia-ffmpeg: + docker-ffmpeg-gpu: +# image: registry.manalejandro.com/docker-ffmpeg-gpu build: ./ - image: nvidia-ffmpeg - container_name: nvidia-ffmpeg + image: docker-ffmpeg-gpu + container_name: docker-ffmpeg-gpu restart: "no" - deploy: - resources: - reservations: - devices: - - driver: nvidia - capabilities: [gpu] environment: - NVIDIA_VISIBLE_DEVICES=all entrypoint: - - /bin/sleep - - infinity + - /ffmpeg volumes: - ./folder:/folder - /usr/lib/x86_64-linux-gnu/nvidia/current:/cuda:ro