Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Extending Rundeck Image With PHP

After learning that Rundeck can run in-line scripts, I immediately tried to run a "hello world" script in PHP. Unfortunately, the Rundeck image does not ship with PHP support, so I decided to create an image that extends the Rundeck image to add this functionality. Below is the Dockerfile.

In future I will turn this into a repository on Github and publish the images to Dockerhub, but it is here for now so I don't lose it.

FROM rundeck/rundeck:4.15.0

USER root

# Fix timezone issue
ENV TZ=ETC/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


# Add ondrej PPA and use it to install PHP 8.2
RUN apt-get update && apt-get install -y software-properties-common apt-transport-https

RUN add-apt-repository ppa:ondrej/php -y \
  && apt-get update \
  && apt-get install -y  \
    composer \
    php8.2-gmagick \
    php8.2-oauth \
    php8.2-sqlite3 \
    php8.2-amqp \
    php8.2-gmp \
    php8.2-odbc \
    php8.2-ssh2 \
    php8.2-gnupg \
    php8.2-opcache \
    php8.2-sybase \
    php8.2-ast \
    php8.2-http \
    php8.2-pcov \
    php8.2-tidy \
    php8.2-bcmath \
    php8.2-igbinary \
    php8.2-pgsql \
    php8.2-uopz \
    php8.2-bz2 \
    php8.2-phpdbg \
    php8.2-uploadprogress \
    php8.2-cgi \
    php8.2-imap \
    php8.2-ps \
    php8.2-uuid \
    php8.2-cli \
    php8.2-interbase \
    php8.2-pspell \
    php8.2-xdebug \
    php8.2-common \
    php8.2-intl \
    php8.2-psr \
    php8.2-xml \
    php8.2-curl \
    php8.2-ldap \
    php8.2-raphf \
    php8.2-xmlrpc \
    php8.2-dba \
    php8.2-mailparse \
    php8.2-readline \
    php8.2-xsl \
    php8.2-dev \
    php8.2-mbstring \
    php8.2-redis \
    php8.2-yac \
    php8.2-ds \
    php8.2-memcache \
    php8.2-rrd \
    php8.2-yaml \
    php8.2-enchant \
    php8.2-memcached \
    php8.2-smbclient \
    php8.2-zip \
    php8.2-fpm \
    php8.2-mongodb \
    php8.2-snmp \
    php8.2-zmq \
    php8.2-gd \
    php8.2-msgpack \
    php8.2-soap \
    php8.2-gearman \
    php8.2-mysql \
    php8.2-solr

USER rundeck

You may wish to build it like so:

docker build . --tag=rundeck:4.15.0-php8.2
Last updated: 26th July 2023
First published: 10th March 2023