Rebuild old PHP Container

Hello, I have restored from backup an old instance of vTiger5.3 whose data I want to access. There is a docker-compose.yml file that calls an image build. In this Dockerfile an old PHP image is loaded and updated. The image is php5.5.30-apache and is based on Debian Jessie(8).
The build does not work anymore because the Jessie packages are no longer available. So I changed the sources.list to
I’ve spied through a few variations - but always get KEY errors or it can’t install packages because the versions/dependencies don’t match.
There should be a way to bring old containers back to life, right?

1 Like

You mention old container, but what you really want to do is starting a new container from an image that you want to build from an old Dockerfile. Am I right?

If that is the case, it is basically a question of how old Debian distributions can be updated or added new packages to it. Recently I had to make a PHP 5.6 work, but that was a little more recent and was based on Debian 9.6.

In my case it turned out that the problem was a certificate authority which was not valid anymore, but the old image still had it. I had to remove that. What is the exact error message?

You are of course right! Thank you for your prompt reply. I had a lot of error messages that changed when I made small adjustments to the Dockerfile, but never got the desired result. When I adjust the sources.list that it uses, I get an error message that the GPG Keys are not correct. After some googling I then typed in apt-key update and got a bit further again. After that I got an error message that libkrb5-dev is not compatible.
However, I think this is where one error causes another.
Can I give you the part of the docker file that is causing problems? In the comments, ther are some thingst i’ve tried …
Many thanks for any help!!!

FROM php:5.6.30-apache

RUN a2enmod rewrite expires

# RUN rm /etc/apt/sources.list
# RUN echo "deb                               jessie           main contrib non-free" > /etc/apt/sources.list
# RUN echo "deb-src                               jessie           main contrib non-free" >> /etc/apt/sources.list
# RUN apt-get update -o Acquire::AllowInsecureRepositories=true
# RUN apt-get install debian-archive-keyring
# RUN apt-get install krb5-multidev

# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libkrb5-dev cron \
    && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
    && docker-php-ext-install gd mysqli mysql \
    && apt-get -y install libssl-dev libc-client2007e-dev libkrb5-dev \
    && docker-php-ext-configure imap --with-imap-ssl --with-kerberos \
    && docker-php-ext-install imap opcache

RUN apt-get install -y --no-install-recommends \
        libmagickwand-dev \
    && rm -rf /var/lib/apt/lists/*

RUN pecl install imagick-3.4.1

Thanks for the Dockerfile. In the meantime, I tried the image and found out that your issue is not what mine was. At least not yet, but will be. The original issue was indeed the gpg key is expired.

I could fix it by using this repo: How to use Extended LTS | Freexian

But I needed to use curl --insecure because the TLS was not recognized which could be what I had before, but the insecure flag helped in this case so it might be unrelated.

Than there is some dependency issue with libpng12-dev, which I don’t know whether it can be solved or not.

Have you considered using a newer PHP version? At least PHP 5.6 and switch to PHP FPM?

I have PHP 5.6 FPM image which already contains most of what you need. Of course not Apache HTTPD which should run in another container and it doesn’t have cron either. This is not the image in which I fixed the repositories, so you still need to fix it again if you want to use apt-get, but otherwise this would get you almost the same PHP:

FROM rimelek/php:5.6-fpm

RUN  docker-php-ext-configure imap --with-imap-ssl --with-kerberos

If you don’t have an existing image, building a new one from an old repo will always be difficult.


I checked how I built imap in the image:

and it seems my image is already what you need without adding the extra RUN instruction, so you can just use rimelek/php:5.6-fpm instead of building an iimage.

Regarding how you can use FPM images, hee is an example from my tutorial:

I used itsziget/php image, but I already switched back to rimelek/php which was my original repo before the other one. I didn’t remove the itsziget images either, so that would probably work too

Thanks again for your help and input. I’ve made some progress and am now facing problems that are more to do with vtiger than docker. i’m going to abandon this old configuration and work out a more modern solution.