1、docker搜索ffmpeg现有镜像
docker search --no-trunc ffmpeg
# 会出来一个列表, 罗列ffmpeg已有镜像,选择使用次数最多且状态OK的那个,现有是jrottenberg/ffmpeg使用的最多
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
jellyfin/ffmpeg 4
vulhub/ffmpeg 0
intel/intel-optimized-ffmpeg Home of Intel-Optimized FFmpeg® 5
linuxserver/ffmpeg 144
chainguard/ffmpeg Minimal image that contains ffmpeg 2
islandora/homarus FFmpeg as a microservice. 0
azamserver/nextcloud-imagemagick-ffmpeg A Nextcloud docker image with ImageMagick & FFmpeg preinstalled 0
jrottenberg/ffmpeg FFmpeg 2.8 - 3.x - 4.x Copyright (c) 2000-2017 the FFmpeg developers 441 [OK]
selenium/video Image with ffmpeg meant to be used with a Dynamic Grid 16
opencoconut/ffmpeg Minimal FFmpeg Docker image built on Alpine Linux 30 [OK]
rupakg/docker-ffmpeg-thumb Docker image for creating thumbnail images from a video file. 4 [OK]
datarhei/ffmpeg FFmpeg Development Image for H.264-Processing 5
krickwix/ffmpeg 0
rafalkrypa/ffmpeg Latest FFmpeg static build on minimal Alpine Linux container 3
sjourdan/ffmpeg FFmpeg on Alpine Docker Image 3 [OK]
onlinetvrecorder/ffmpeg 0
umnelevator/ffmpeg 0
mwader/static-ffmpeg Multi-arch docker image with ffmpeg/ffprobe binaries built as hardened static PIE binaries 30 [OK]
nicolasarnaud4viseo/ffmpeg 0
mortimor/php5-fpm-ffmpeg-socket 0
aburkleaux/docker-ffmpeg-thumb Tutorial:https://serverless.com/blog/serverless-application-for-long-running-process-fargate-lambda/ 0
alfg/ffmpeg An FFmpeg Dockerfile from source. Built on Alpine Linux. 7 [OK]
bforchhammer/python-ffmpeg Python 2.7 with ffmpeg+waveform 1 [OK]
abema/ffmpeg 0
akhilrajmailbox/ffmpeg
2、本地拉取镜像
docker pull jrottenberg/ffmpeg
3、保存为tar文件
# 查看镜像列表
docker images
# 保存镜像为tar文件,方便下载到本地传输到离线服务器
docker save -o ffmpeg.tar jrottenberg/ffmpeg:latest
4、传输至远程离线服务器
导出的 tar 包可以通过 scp 或者 ftp 将其传输至离线服务器。
5、加载镜像到离线服务器
docker load -i ffmpeg.tar
6、根据需求构建容器
# 个人的需求是最近在迁移系统,之前是基于ECS直接部署的,现改为k8s容器化部署,所以需要将ffmpeg抽出来单独的容器,所以直接通过k8s depolyment.yml指定ffmpeg镜像构建容器即可
apiVersion: apps/v1
kind: Deployment
metadata:
name: your-service-deployment
labels:
app: your-service
spec:
replicas: 1
selector:
matchLabels:
app: your-service
template:
metadata:
labels:
app: your-service
spec:
volumes:
- name: shared-volume
emptyDir: {}
containers:
- name: python-service
image: your-python-image:latest
command: ["/bin/bash", "-c", "python your-python-script.py"]
ports:
- containerPort: 8080 # 如果需要暴露端口
volumeMounts:
- name: shared-volume
mountPath: /data
- name: ffmpeg-container
image: ffmpeg:latest # FFmpeg镜像
command: ["/bin/bash", "-c", "ffmpeg -version"] # 仅用于验证FFmpeg是否正常
ports:
- containerPort: 8081 # 如果需要暴露端口
volumeMounts:
- name: shared-volume
mountPath: /data