Skip to content

Commit

Permalink
Mirror on ghcr.io (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrottenberg authored Dec 5, 2021
1 parent 6859497 commit 071697a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 34 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# FFmpeg Docker image

[![Docker Stars](https://img.shields.io/docker/stars/jrottenberg/ffmpeg.svg?style=plastic)](https://registry.hub.docker.com/v2/repositories/jrottenberg/ffmpeg/stars/count/) [![Docker pulls](https://img.shields.io/docker/pulls/jrottenberg/ffmpeg.svg?style=plastic)](https://registry.hub.docker.com/v2/repositories/jrottenberg/ffmpeg/)
[![gitlab pipeline status](https://gitlab.com/jrottenberg/ffmpeg/badges/master/pipeline.svg)](https://gitlab.com/jrottenberg/ffmpeg/commits/master)
[![Docker Stars](https://img.shields.io/docker/stars/jrottenberg/ffmpeg.svg?logo=docker&style=plastic)](https://registry.hub.docker.com/v2/repositories/jrottenberg/ffmpeg/stars/count/)
[![Docker pulls](https://img.shields.io/docker/pulls/jrottenberg/ffmpeg.svg?logo=docker&style=plastic)](https://registry.hub.docker.com/v2/repositories/jrottenberg/ffmpeg/)
[![Docker Automated build](https://img.shields.io/docker/automated/jrottenberg/ffmpeg.svg?logo=docker)](https://hub.docker.com/r/jrottenberg/ffmpeg/tags)
[![Huthub Container Registry Images](https://img.shields.io/badge/images-automated-blue?logo=github&style=plastic)](https://github.com/jrottenberg/ffmpeg/pkgs/container/ffmpeg)
[![gitlab pipeline status](https://gitlab.com/jrottenberg/ffmpeg/badges/main/pipeline.svg)](https://gitlab.com/jrottenberg/ffmpeg/commits/main)
[![Azure Build Status](https://dev.azure.com/video-tools/ffmpeg/_apis/build/status/jrottenberg.ffmpeg)](https://dev.azure.com/video-tools/ffmpeg/_build/latest?definitionId=1)
[![Docker Automated build](https://img.shields.io/docker/automated/jrottenberg/ffmpeg.svg?maxAge=2592000?style=plastic)](https://github.com/jrottenberg/ffmpeg/)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/jrottenberg/ffmpeg/master.svg)](https://results.pre-commit.ci/latest/github/jrottenberg/ffmpeg/master)


This project prepares a minimalist Docker image with FFmpeg. It compiles FFmpeg from sources following instructions from the [Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide).

You can install the latest build of this image by running `docker pull jrottenberg/ffmpeg`.
You can install the latest build of this image by running `docker pull jrottenberg/ffmpeg:${VERSION}-${VARIANT}` or `docker pull ghcr.io/jrottenberg/ffmpeg:${VERSION}-${VARIANT}`.

This image can be used as a base for an encoding farm.

## Builds

There are different builds available:
- alpine based images `ffmpeg:<version>-alpine38` or `ffmpeg:<version>-alpine312` (the `ffmpeg:<version>-alpine` builds are not updated any more)
- alpine based scratch images `ffmpeg:<version>-scratch38` or `ffmpeg:<version>-scratch312` (experimental image containing only FFmpeg and libraries, the `ffmpeg:<version>-alpine` builds are not updated any more)
- centos based images `ffmpeg:<version>-centos7` or `ffmpeg:<version>-centos8`
- ubuntu based images `ffmpeg:<version>-ubuntu1804` or `ffmpeg:<version>-ubuntu2004` (the default, you can also use `ffmpeg:<version>-ubuntu` as an alias)
- ubuntu based nvidia images `ffmpeg:<version>-nvidia1804`
- ubuntu based vaapi images `ffmpeg:<version>-vaapi1804` or `ffmpeg:<version>-vaapi2004`
- alpine based images `ffmpeg:<version>-alpine` or `ffmpeg:<version>-alpine313` (old versions with `ffmpeg:<version>-alpine312` , `ffmpeg:<version>-alpine311`)
- alpine based scratch images `ffmpeg:<version>-scratch` or `ffmpeg:<version>-scratch313` (old versions with `ffmpeg:<version>-scratch312` , `ffmpeg:<version>-scratch311`)
- centos based images `ffmpeg:<version>-centos` or `ffmpeg:<version>-centos7` or `ffmpeg:<version>-centos8`
- ubuntu based images `ffmpeg:<version>-ubuntu` or `ffmpeg:<version>-ubuntu2004` (old versions with `ffmpeg:<version>-ubuntu1804` , `ffmpeg:<version>-ubuntu1604`)
- ubuntu based nvidia images `ffmpeg:<version>-nvidia` or `ffmpeg:<version>-nvidia2004` (old versions with `ffmpeg:<version>-nvidia1804`, `ffmpeg:<version>-nvidia1604`)
- ubuntu based vaapi images `ffmpeg:<version>-vaapi1804` or `ffmpeg:<version>-vaapi2004` (old versions with `ffmpeg:<version>-vaapi1804`, `ffmpeg:<version>-nvidia1604`)

`<version>` can be one of the following:
- 3.2
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ variables:
- group: videotoolsbuild-dockerhub
- name: DOCKER
value: jrottenberg/ffmpeg
- name: GHCR
value: ghcr.io/jrottenberg/ffmpeg

stages:
- stage: lint
Expand Down
55 changes: 32 additions & 23 deletions templates/azure-steps.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
steps:
- bash: |
set -eu
docker build -t ${DOCKER}:${VERSION}-${VARIANT} -t ${DOCKER}:${LONG_VERSION}-${VARIANT} -t ${GHCR}/${VERSION}-${VARIANT} -t ${GHCR}/${LONG_VERSION}-${VARIANT} --build-arg MAKEFLAGS="-j$(($(grep -c ^processor /proc/cpuinfo) + 1))" docker-images/${VERSION}/${VARIANT}
docker run --rm ${DOCKER}:${LONG_VERSION}-${VARIANT} -buildconf
docker images
displayName: Build docker image
steps:
- bash: |
set -eu
docker build -t ${DOCKER}:${VERSION}-${VARIANT} -t ${DOCKER}:${LONG_VERSION}-${VARIANT} --build-arg MAKEFLAGS="-j$(($(grep -c ^processor /proc/cpuinfo) + 1))" docker-images/${VERSION}/${VARIANT}
docker run --rm ${DOCKER}:${LONG_VERSION}-${VARIANT} -buildconf
docker images
displayName: Build docker image
- bash: |
set -eu
echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_LOGIN} --password-stdin
docker push ${DOCKER}:${VERSION}-${VARIANT}
docker push ${DOCKER}:${LONG_VERSION}-${VARIANT}
- bash: |
set -eu
docker login --username ${DOCKER_LOGIN} --password ${DOCKER_PASSWORD}
docker push ${DOCKER}:${VERSION}-${VARIANT}
docker push ${DOCKER}:${LONG_VERSION}-${VARIANT}
if [ "${ISPARENT}" == "True" ] && [ "${VARIANT}" != "${PARENT}" ]
then
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${VERSION}-${PARENT}"
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${MAJOR_VERSION}-${PARENT}"
docker push "${DOCKER}:${VERSION}-${PARENT}"
docker push "${DOCKER}:${MAJOR_VERSION}-${PARENT}"
echo ${GHCR_PAT} | docker login ghcr.io --username USERNAME --password-stdin
docker push ${GHCR}/${VERSION}-${VARIANT}
docker push ${GHCR}/${LONG_VERSION}-${VARIANT}
fi
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Push docker image
env:
DOCKER_PASSWORD: $(docker.password)
if [ "${ISPARENT}" == "True" ] && [ "${VARIANT}" != "${PARENT}" ]
then
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${VERSION}-${PARENT}"
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${MAJOR_VERSION}-${PARENT}"
docker push "${DOCKER}:${VERSION}-${PARENT}"
docker push "${DOCKER}:${MAJOR_VERSION}-${PARENT}"
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${GHCR}:${VERSION}-${PARENT}"
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${GHCR}:${MAJOR_VERSION}-${PARENT}"
docker push "${GHCR}:${VERSION}-${PARENT}"
docker push "${GHCR}:${MAJOR_VERSION}-${PARENT}"
fi
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
displayName: Push docker image
env:
DOCKER_PASSWORD: $(docker.password)
GHCR_PAT: $(ghcr.pat)

0 comments on commit 071697a

Please sign in to comment.