Opening Adobe Flash in Docker in 2024

I was surfing around the Internet looking for a video of events from 15 years ago and found something similar to what I was looking for, but I couldn’t watch it – Adobe Flash was required. I Googled how I could open this video, but I couldn’t find any working options. “Okay,” I thought: “Challenge accepted.” And the reader and I have an extra opportunity to practice creating Docker containers.

Disclaimer: Using outdated versions of the browser and the Flash plugin itself poses a potential security risk. Use this method at your own risk.

So, let's start with the fact that support for the Flash plugin was cut into Chromium starting with version 89. That is, we need something that has an earlier version. This is something – this is Ubuntu 18.04 – it’s version 65, if without updates, but with updates it’s version 112. At some point there should have been an 88th, but I couldn’t find where to get it – if the reader can tell me, I will be immensely grateful. And so, let's go – create a Dockerfile

FROM ubuntu:18.04

ARG DEBIAN_FRONTEND=noninteractive
ARG CHROMIUM_VERSION=65.0.3325.181-0ubuntu1

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y \
    chromium-browser=$CHROMIUM_VERSION \
    chromium-browser-l10n=$CHROMIUM_VERSION \
    chromium-codecs-ffmpeg-extra=$CHROMIUM_VERSION \
    apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/*

We take the official image of ubuntu:18.04 as a basis. We get a list of packages, install updates and install the browser itself, explicitly indicating the version – otherwise the latest (at the time of writing) 112 will be installed.

The last (12th) line removes from this “layer” downloaded deb files and caches required by the apt command. This is a good practice when working with containers.

We will run it as a user, otherwise Chromium will complain. Let's create it, but without a password:

RUN adduser --gecos "user" --disabled-password --shell /bin/bash user

Let's download the actual archive with the latest version of the Flash plugin for Chromium, which was randomly saved in the Internet Archive:

ADD https://web.archive.org/web/20210000000000id_/https://fpdownload.adobe.com/get/flashplayer/pdc/32.0.0.465/flash_player_ppapi_linux.x86_64.tar.gz /tmp

I would like to draw your attention to a useful property of the ADD directive, which many people forget about – you can add not only files from the local Docker context, but also from an arbitrary URL.

Next, let’s take a look at some actions and configs from the once-existing pepperflashplugin-nonfree package:

COPY etc /etc

RUN mkdir -p /usr/lib/pepperflashplugin-nonfree && \
    tar -xz -f /tmp/flash_player_ppapi_linux.x86_64.tar.gz -C /usr/lib/pepperflashplugin-nonfree libpepflashplayer.so manifest.json && \
	chown root:root /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so && \
	chmod 644 /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so && \
	chown root:root /usr/lib/pepperflashplugin-nonfree/manifest.json && \
	chmod 644 /usr/lib/pepperflashplugin-nonfree/manifest.json

Install DISPLAY for the X server

ENV DISPLAY=:0

And, it would seem, you can run Chromium, but having done so, we run into the first trouble: the plugin will check the current time and, if it has passed some time in January 2021, then it will refuse to work. Therefore, over time, you need to deceive it; for this, you need to include the package in the list of installed packages along with Chromium faketime. Running Chromium under faketime, we will encounter another problem – SSL certificates will not be verified, since they are all issued in the future (for our fake time). Therefore, you will have to ignore certificate errors using a browser setting --ignore-certificate-errors. As a result, we get the following entry point into the container

CMD ["/usr/bin/faketime", "2020-12-24 08:15:42", "/usr/bin/chromium-browser", "--ignore-certificate-errors"]

We build a Docker image, for example, with the following command:

docker build -t flash-image  .

And we start this thing with the following command:

docker run -it --rm --user user:user -v /tmp/.X11-unix/:/tmp/.X11-unix  --cap-add SYS_ADMIN flash-image

And here is a page chronicling the harsh everyday life of Russia, where you can check it: https://www.zaks.ru/new/archive/view/68760

You can get all of this in finished form in the repository https://github.com/dmitrmax/flash-in-docker

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *