How to install HandBrake CLI in Docker container?

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
ksilz
Posts: 2
Joined: Fri Jul 24, 2020 11:07 am

How to install HandBrake CLI in Docker container?

Post by ksilz »

Description of problem or question:

I want to install the latest CLI version of HandBrake into a Docker container so that my Java app can call the HandBrake CLI.


Steps to reproduce the problem (If Applicable):

Here's my Dockerfile:

Code: Select all

FROM ubuntu:18.04

COPY ./sources.list /etc/apt/sources.list

RUN   apt-get clean && \
      rm -rf \
        /var/lib/apt/lists/* \
        /tmp/* \
        /var/tmp/* && \
      apt-get update && \
      apt-get install -y \
        handbrake-cli

RUN   /usr/bin/HandBrakeCLI --version
And here's the sources.list that I use. It includes official Ubuntu repositories and the official HandBrake PPA:

Code: Select all

###### Ubuntu Main Repos
deb http://uk.archive.ubuntu.com/ubuntu/ bionic main

###### Ubuntu Update Repos
deb http://uk.archive.ubuntu.com/ubuntu/ bionic-security main
deb http://uk.archive.ubuntu.com/ubuntu/ bionic-updates main

###### HandBrake Repo
deb [trusted=yes] http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu cosmic Release
This is the command I use to build the image:

Code: Select all

docker build -t handbrake-problem:1.0.0 . --no-cache
But the HandBrake PPA at http://ppa.launchpad.net/stebbins/handb ... ses/ubuntu is ignored. Hence, no source for the HandBrake CLI installation can be found. See below for details.

HandBrake version (e.g., 1.0.0):

1.3.3

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Docker image for ubuntu:18.04

HandBrake Activity Log ***required*** (see How-to get an activity log)

Here's the result of my Docker build process:

Code: Select all

Sending build context to Docker daemon  3.072kB
Step 1/4 : FROM ubuntu:18.04
 ---> d27b9ffc5667
Step 2/4 : COPY ./sources.list /etc/apt/sources.list
 ---> 37f04073fb49
Step 3/4 : RUN   apt-get clean &&       rm -rf         /var/lib/apt/lists/*         /tmp/*         /var/tmp/* &&       apt-get update &&       apt-get install -y         handbrake-cli
 ---> Running in 2bb9a391f8ea
Get:1 http://uk.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu cosmic InRelease [15.4 kB]
Get:3 http://uk.archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://uk.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Ign:2 http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu cosmic InRelease
Get:5 http://uk.archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:6 http://uk.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [1023 kB]
Get:7 http://uk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1322 kB]
Fetched 4125 kB in 1s (5074 kB/s)
Reading package lists...
W: GPG error: http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu cosmic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8771ADB0816950D8
W: Skipping acquire of configured file 'Release/binary-amd64/Packages' as repository 'http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu cosmic InRelease' doesn't have the component 'Release' (component misspelt in sources.list?)
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package handbrake-cli
The command '/bin/sh -c apt-get clean &&       rm -rf         /var/lib/apt/lists/*         /tmp/*         /var/tmp/* &&       apt-get update &&       apt-get install -y         handbrake-cli' returned a non-zero code: 100
The key is this line:

Code: Select all

W: Skipping acquire of configured file 'Release/binary-amd64/Packages' as repository 'http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu cosmic InRelease' doesn't have the component 'Release' (component misspelt in sources.list?)

ksilz
Posts: 2
Joined: Fri Jul 24, 2020 11:07 am

Re: How to install HandBrake CLI in Docker container?

Post by ksilz »

I fixed it by using this Dockerfile as a template:
https://github.com/tianon/dockerfiles/b ... Dockerfile

Post Reply