How to install ffmpeg in a docker container - docker

I'm using aeneas python module which uses ffmpeg. I install ffmpeg in the dockerfile as follows:
RUN apt-get update && apt-get install -y ffmpeg
Now when I run the program, it fails with: aeneas.ffprobewrapper.FFPROBEPathError: Unable to call the 'ffprobe' ffprobe executable : [Errno 2] No such file or directory: 'ffprobe' and aeneas.audiofile.AudioFileProbeError: Unable to call ffprobe executable. So my question is, how can I successfully use ffmpeg in a docker container? I'm running Ubuntu 16.04.

Install fresh ffmpeg version from sources in docker container on Debian 9/10/Ubuntu.
You can replace 4.2.2 version to any other available on https://ffmpeg.org/releases/
# Compile and install fresh ffmpeg from sources:
# See: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
RUN apt-get update -qq && apt-get -y install \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
pkg-config \
texinfo \
wget \
zlib1g-dev \
nasm \
yasm \
libx265-dev \
libnuma-dev \
libvpx-dev \
libmp3lame-dev \
libopus-dev \
libx264-dev \
libfdk-aac-dev
RUN mkdir -p ~/ffmpeg_sources ~/bin && cd ~/ffmpeg_sources && \
wget -O ffmpeg-4.2.2.tar.bz2 https://ffmpeg.org/releases/ffmpeg-4.2.2.tar.bz2 && \
tar xjvf ffmpeg-4.2.2.tar.bz2 && \
cd ffmpeg-4.2.2 && \
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--extra-libs="-lpthread -lm" \
--bindir="$HOME/bin" \
--enable-libfdk-aac \
--enable-gpl \
--enable-libass \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree && \
PATH="$HOME/bin:$PATH" make -j8 && \
make install -j8 && \
hash -r
RUN mv ~/bin/ffmpeg /usr/local/bin && mv ~/bin/ffprobe /usr/local/bin && mv ~/bin/ffplay /usr/local/bin

It could be faulty library, then this should help:
apt-get install ffmpeg libavcodec-extra-53
If not it can be path problem:
$ffmpeg = FFMpeg\FFMpeg::create(array(
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
'ffprobe.binaries' => '/usr/bin/ffprobe'));
The similar issue resolved here: https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/172
in the last message on the bottom of the website.

You can do it if you have linux. Or anywhere you can install X (haven't tested it). Basic idea is that linux is using X11, so you can fart out X data to your host machine's X server.
Dockerfile
FROM ubuntu:latest
RUN apt-get update -qq && apt-get install ffmpeg -y
ENTRYPOINT ["ffplay"]
Build that with
docker build -t ffplay:latest .
play.sh
docker run \
--rm \
-u `id -u` \
-e DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v "$HOME/Desktop:/media" \
ffplay:latest \
-i /media/test.mp4

Related

How to define the setting in the docker image not run through jupyter notebook

I am trying to run the below docker image from https://hub.docker.com/r/fbcotter/docker-tensorflow-
opencv/
FROM tensorflow/tensorflow:1.8.0-py3
RUN apt-get update
RUN apt-get install -y \
build-essential \
cmake \
git \
wget \
unzip \
yasm \
pkg-config \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libjasper-dev \
libavformat-dev \
libhdf5-dev \
libpq-dev
RUN pip3 --no-cache-dir install \
numpy \
hdf5storage \
h5py \
scipy \
py3nvml
WORKDIR /
ENV OPENCV_VERSION="3.4.1"
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip \
&& unzip ${OPENCV_VERSION}.zip \
&& mkdir /opencv-${OPENCV_VERSION}/cmake_binary \
&& cd /opencv-${OPENCV_VERSION}/cmake_binary \
&& cmake -DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DWITH_CUDA=OFF \
-DENABLE_AVX=ON \
-DWITH_OPENGL=ON \
-DWITH_OPENCL=ON \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
-DPYTHON_EXECUTABLE=$(which python3) \
-DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc;
print(get_python_inc())") \
-DPYTHON_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib())") .. \
&& make install \
&& rm /${OPENCV_VERSION}.zip \
&& rm -r /opencv-${OPENCV_VERSION}
RUN pip3 install -q keras==2.3.1
RUN pip3 install pyzmq
RUN pip3 install pillow
RUN mkdir -p /edge_app/src
WORKDIR /edge_app/src
COPY . ./
#CMD ["python","streamer.py"]
Command to run the docker image
docker run --rm -it -p:ip:port:port test
When I run the above docker image I am able to access it through Jupyter notebook. My question how to disable the jupyter notebook, because I want to access the docker container through bash.
Thanks, help is highly appreciated.
You could directly run your container with a custom command:
docker run -it -p port:port test /bin/bash

Docker openCV installation Issues

I'm currently trying to run an application using Docker but get the following error message when I start the application:
error while loading shared libraries: libopencv_highgui.so.4.4: cannot open shared object file: No such file or directory
I assume that something is going wrong in the docker file and that the installation is not complete or correct. Therefore I have added the section about OpenCV at the end of the post.
Did I miss an important step or an error in the dockerfile?
FROM nvidia/cuda:10.2-devel-ubuntu18.04 as TOOLKITS
RUN apt-get update && apt-get install -y apt-utils
# Install additional packages
RUN apt-get install -y \
build-essential \
bzip2 \
checkinstall \
cmake \
curl \
gcc \
gfortran \
git \
pkg-config \
python3-pip \
python3-dev \
python3-numpy \
nano \
openexr \
unzip \
wget \
yasm
FROM TOOLKITS as GIT_PULLS
WORKDIR /
RUN git clone https://github.com/opencv/opencv.git
RUN git clone https://github.com/opencv/opencv_contrib.git
FROM GIT_PULLS as OPENCV_PREPERATION
RUN apt-get install -y \
libgtk-3-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libv4l-dev \
libxvidcore-dev \
libx264-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libatlas-base-dev \
libtbb2 \
libtbb-dev \
libdc1394-22-dev
FROM OPENCV_PREPERATION as OPENCV_CMAKE
WORKDIR /
RUN mkdir /opencv/build
WORKDIR /opencv/build
RUN cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DINSTALL_C_EXAMPLES=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DWITH_TBB=ON \
-DWITH_V4L=ON \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DWITH_OPENGL=ON \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-DOPENCV_PC_FILE_NAME=opencv.pc \
-DBUILD_EXAMPLES=ON ..
FROM OPENCV_CMAKE as BUILD_OPENCV_MAKE
RUN make -j $(nproc)
RUN make install
FROM TOOLKITS
COPY --from=XXX /opencv /opencv
COPY --from=XXX /opencv_contrib /opencv_contrib
I was facing the same issue before when installing OpenCV in Docker with Python image. You probably don't need this much dependencies but it's an option. I will have a lightweight version that fits my case. Please give a try for the following code:
Heavy-loaded version:
FROM python:3.7
RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
git \
wget \
unzip \
yasm \
pkg-config \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libavformat-dev \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pip install numpy
WORKDIR /
ENV OPENCV_VERSION="4.1.1"
# install opencv-python from its source
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip \
&& unzip ${OPENCV_VERSION}.zip \
&& mkdir /opencv-${OPENCV_VERSION}/cmake_binary \
&& cd /opencv-${OPENCV_VERSION}/cmake_binary \
&& cmake -DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DWITH_CUDA=OFF \
-DWITH_OPENGL=ON \
-DWITH_OPENCL=ON \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$(python3.7 -c "import sys; print(sys.prefix)") \
-DPYTHON_EXECUTABLE=$(which python3.7) \
-DPYTHON_INCLUDE_DIR=$(python3.7 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_PACKAGES_PATH=$(python3.7 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
.. \
&& make install \
&& rm /${OPENCV_VERSION}.zip \
&& rm -r /opencv-${OPENCV_VERSION}
RUN ln -s \
/usr/local/python/cv2/python-3.7/cv2.cpython-37m-x86_64-linux-gnu.so \
/usr/local/lib/python3.7/site-packages/cv2.so
RUN apt-get --fix-missing update && apt-get --fix-broken install && apt-get install -y poppler-utils && apt-get install -y tesseract-ocr && \
apt-get install -y libtesseract-dev && apt-get install -y libleptonica-dev && ldconfig && apt install -y libsm6 libxext6 && apt install -y python-opencv
Lightweight version:
FROM python:3.7
RUN apt-get update -y
RUN apt-update && apt install -y libsm6 libxext6
For my case, I ended up using the heavy-loaded version just to save some hassle and both versions should work fine. For your reference, please also see this link and thanks to Neo Anderson's great help.
I also had lots of issues in this process, and found this repository:
https://github.com/janza/docker-python3-opencv
Clone or download this and add the additional dependencies and files according to your requirement.
apt-get update -y
apt install -y libsm6 libxext6
apt update
pip install pyglview
apt install -y libgl1-mesa-glx

Docker build fails with dependency issues even though I am satisfying them

I'm looking for ideas as to why this is failing.
I've done the same steps on my host and they work well, the packages I'm calling out provide the needed dependencies.
Build Command:
docker build -t testbuild .
DockerFile:
FROM registry.redhat.io/rhel7:latest
RUN yum install -y yum-utils
RUN yum-config-manager --enable \
EPEL_7_EPEL_7 \
Community_mysql-connectors-community \
Community_mysql-tools-community \
Community_mysql57-community \
rhel-7-server-extras-rpms/x86_64 \
rhel-7-server-optional-rpms/7Server/x86_64 \
rhel-7-server-rh-common-rpms/7Server/x86_64 \
rhel-7-server-rpms/7Server/x86_64 \
rhel-server-rhscl-7-rpms/7Server/x86_64
RUN true \
&& yum install -y \
cairo \
yum-utils\
collectd \
openldap-devel \
rrdtool \
gcc \
rrdtool-devel \
pyrrd \
rrdtool-python \
python-ldap \
wget \
pycairo-devel \
pycairo \
python-devel \
collectd-nginx \
findutils \
rrdtool \
logrotate \
memcached \
nginx \
nodejs \
npm \
redis \
pkgconfig \
sqlite \
expect \
git \
python3\
python3-devel\
libffi-devel \
postgresql-devel \
postgresql-devel \
mysql-community-client \
mysql-community-libs \
mysql-community-common \
mysql-community-libs-compat
RUN yum clean all
RUN pip3 install \
virtualenv\
# && /usr/bin/easy_install virtualenv \
&& /usr/local/bin/virtualenv /opt/graphite \
&& . /opt/graphite/bin/activate \
&& pip3 install \
PyMySQL \
django==1.11.24 \
django-statsd-mozilla \
fadvise \
gunicorn \
msgpack-python \
redis \
rrdtool \
python-ldap \
mysqlclient \
psycopg2
The error I am getting is ERROR: Command errored out with exit status 1:
command: /opt/graphite/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-67zlal6a/rrdtool/setup.py'"'"';
file='"'"'/tmp/pip-install-67zlal6a/rrdtool/setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-67zlal6a/rrdtool/
Complete output (5 lines):
/tmp/tmp_python_rrdtoolfr1k715h/test_rrdtool.c:2:17: fatal error: rrd.h: No such file or directory
#include
^
compilation terminated.
Error: Unable to compile the binary module. Do you have the rrdtool header and libraries installed?
---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for
full command output.
But I've ensured the files exist with the yum-installed packages.
I've commented out this package and then I get a mysql_config error which I also don't get on my current test host. Which leads me to believe something is going wrong earlier in the build.
Any Ideas?
Don't have access to RHEL repository, so I tried with centos 7 and was having same issues.
But installing these additional packages helped to successfully build image:
RUN yum install -y epel-release
RUN yum install -y python36-pip
RUN yum install -y mysql mysql-devel
RUN yum install -y python36-devel
Here is final DockerFile:
FROM centos:7
RUN yum install -y yum-utils
RUN yum-config-manager --enable \
EPEL_7_EPEL_7 \
Community_mysql-connectors-community \
Community_mysql-tools-community \
Community_mysql57-community \
rhel-7-server-extras-rpms/x86_64 \
rhel-7-server-optional-rpms/7Server/x86_64 \
rhel-7-server-rh-common-rpms/7Server/x86_64 \
rhel-7-server-rpms/7Server/x86_64 \
rhel-server-rhscl-7-rpms/7Server/x86_64
RUN true \
&& yum install -y \
cairo \
yum-utils\
collectd \
openldap-devel \
rrdtool \
gcc \
rrdtool-devel \
pyrrd \
rrdtool-python \
python-ldap \
wget \
pycairo-devel \
pycairo \
python-devel \
collectd-nginx \
findutils \
rrdtool \
logrotate \
memcached \
nginx \
nodejs \
npm \
redis \
pkgconfig \
sqlite \
expect \
git \
python3\
python3-devel\
libffi-devel \
postgresql-devel \
postgresql-devel \
mysql-community-client \
mysql-community-libs \
mysql-community-common \
mysql-community-libs-compat
RUN yum install -y epel-release
RUN yum install -y python36-pip
RUN yum install -y mysql mysql-devel
RUN yum install -y python36-devel
RUN yum clean all
RUN pip3 install \
virtualenv\
&& /usr/local/bin/virtualenv /opt/graphite \
&& . /opt/graphite/bin/activate \
&& pip3 install \
PyMySQL \
django==1.11.24 \
django-statsd-mozilla \
fadvise \
gunicorn \
msgpack-python \
redis \
rrdtool \
python-ldap \
mysqlclient \
psycopg2

Docker: How to use Volumes for desktop applications

Let's take an example. Here, I'm trying to read an image and write it in a temp folder, using opencv. I want to put this desktop application on Docker and save the output using Docker volume. From volumes, I want to save the output to my local machine.
For the problem statement, I assigned a volume to the container, so that I can save the output. When I'm running the code, it's getting executed, but I'm not understanding how to save to local machine.
This is the DockerFile for the opencv example:
FROM python:3.7
RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
git \
wget \
unzip \
yasm \
pkg-config \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libavformat-dev \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pip install numpy
ENV OPENCV_VERSION="4.1.0"
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip \
&& unzip ${OPENCV_VERSION}.zip \
&& mkdir /opencv-${OPENCV_VERSION}/cmake_binary \
&& cd /opencv-${OPENCV_VERSION}/cmake_binary \
&& cmake -DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DWITH_CUDA=OFF \
-DWITH_OPENGL=ON \
-DWITH_OPENCL=ON \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$(python3.7 -c "import sys; print(sys.prefix)") \
-DPYTHON_EXECUTABLE=$(which python3.7) \
-DPYTHON_INCLUDE_DIR=$(python3.7 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_PACKAGES_PATH=$(python3.7 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
.. \
&& make install \
&& rm /${OPENCV_VERSION}.zip \
&& rm -r /opencv-${OPENCV_VERSION}
RUN ln -s \
/usr/local/python/cv2/python-3.7/cv2.cpython-37m-x86_64-linux-gnu.so \
/usr/local/lib/python3.7/site-packages/cv2.so
WORKDIR /opencv_example
COPY . .
I need some help to understand how Docker volumes are used for desktop applications and the code to save the volume's output in local path.
How are you starting the container? Paste your command.
If you're using Windows, you need to enable shared drives in Docker settings, and then start your container like written below. If you're on MacOS or Linux, then you only need to execute the command. (Given you probably have other flags there as well)
docker run -v <path-on-host>:<path-inside-container> <image-name>
For more reference check out this link.

PHP 7.1 Docker build will not compile with pgsql

I am using the polinux/httpd:centos repo to run Apache and PHP 7.1. The build seems to go ok. There are a few warnings related to keys, but none related to php or pgsql. The build completes successfully, but when I ssh into the container the module is not listed (php -m) and there's no extension config file in php.d.
I verified it is listed in the Dockerfile multiple times.
I can install php71-php-pgsql manually after starting the container, but then I can't restart Apache without restarting the container.
I've tried moving yum install php71-php-pgsql to the end of the Dockerfile as a separate RUN command (in addition to the original), but it reports it has already been installed, yet when I ssh into the container its not listed in the modules and no config, as mentioned above.
When I rebuild a container I stop and remove it, then run build with the no-cache option.
I'm stumped...
The Dockerfile is quite long, but I can post if that would be helpful.
Thanks.
UPDATE: Dockerfile per request...
FROM polinux/httpd:centos
ENV \
NVM_DIR="/usr/local/nvm" \
NODE_VERSION="9.2.0" \
GIT_VERSION="2.15.0" \
PHP_VERSION="71"
ADD mariadb.repo /etc/yum.repos.d/mariadb.repo
RUN \
rpm --rebuilddb && yum clean all && rm -rf /var/cache/yum && \
yum update -y && \
yum install -y \
wget \
patch \
bzip2 \
unzip \
make \
openssh-clients \
git \
MariaDB-client && \
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm && \
yum install -y \
php${PHP_VERSION}-php \
php${PHP_VERSION}-php-bcmath \
php${PHP_VERSION}-php-cli \
php${PHP_VERSION}-php-common \
php${PHP_VERSION}-php-devel \
php${PHP_VERSION}-php-fpm \
php${PHP_VERSION}-php-gd \
php${PHP_VERSION}-php-gmp \
php${PHP_VERSION}-php-intl \
php${PHP_VERSION}-php-json \
php${PHP_VERSION}-php-mbstring \
php${PHP_VERSION}-php-mcrypt \
php${PHP_VERSION}-php-mysqlnd \
php${PHP_VERSION}-php-pgsql \
php${PHP_VERSION}-php-opcache \
php${PHP_VERSION}-php-pdo \
php${PHP_VERSION}-php-pear \
php${PHP_VERSION}-php-process \
php${PHP_VERSION}-php-pspell \
php${PHP_VERSION}-php-xml \
php${PHP_VERSION}-php-pecl-imagick \
php${PHP_VERSION}-php-pecl-mysql \
php${PHP_VERSION}-php-pecl-uploadprogress \
php${PHP_VERSION}-php-pecl-uuid \
php${PHP_VERSION}-php-pecl-memcache \
php${PHP_VERSION}-php-pecl-memcached \
php${PHP_VERSION}-php-pecl-redis \
php${PHP_VERSION}-php-pecl-zip && \
ln -sfF /opt/remi/php${PHP_VERSION}/enable /etc/profile.d/php${PHP_VERSION}-paths.sh && \
ln -sfF /opt/remi/php${PHP_VERSION}/root/usr/bin/{pear,pecl,phar,php,php-cgi,php-config,phpize} /usr/local/bin/. && \
mv -f /etc/opt/remi/php${PHP_VERSION}/php.ini /etc/php.ini && ln -s /etc/php.ini /etc/opt/remi/php${PHP_VERSION}/php.ini && \
rm -rf /etc/php.d && mv /etc/opt/remi/php${PHP_VERSION}/php.d /etc/. && ln -s /etc/php.d /etc/opt/remi/php${PHP_VERSION}/php.d && \
yum install -y \
ImageMagick \
GraphicsMagick \
gcc \
gcc-c++ \
libffi-devel \
libpng-devel \
zlib-devel && \
yum install -y ruby ruby-devel && \
echo 'gem: --no-document' > /etc/gemrc && \
gem update --system && \
gem install bundler && \
export PROFILE=/etc/profile.d/nvm.sh && touch $PROFILE && \
curl -sSL https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash && \
source $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use default && \
npm install -g \
gulp \
grunt-cli \
bower \
browser-sync && \
echo -e "StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
chown apache /usr/local/bin/composer && composer --version && \
yum clean all && rm -rf /tmp/yum* && \
sed -i 's|SetHandler application/x-httpd-php|SetHandler "proxy:fcgi://127.0.0.1:9000"|g' /etc/httpd/conf.d/php${PHP_VERSION}-php.conf
ADD container-files /
ENV \
NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules \
PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN \
mkdir -p /data/tmp/php && \
chmod -R 777 /data/tmp
# Weird issue: For some reason pgsql is not installed above. May be OoO...
Manually installing worked, so adding here at the end.
RUN \
yum install php71-php-pgsql -y
Chalk this up to inexperience...
This turned out to be a problem with how I was referencing images, first when building and then running the instance. I'm still not sure I fully understand, but I think I was running the base container instead of the modified build.
For others that may run into similar problems, the 2 commands that helped me get this working are:
docker build --rm -t local/httpd-php71 .
... and then ...
docker run \
-d \
--name httpd-php71 \
--restart unless-stopped \
--net dockersubnet \
--volume /www:/var/www \
local/httpd-php71
Where 'local/httpd-php71' is my local/custom build. Before I was not using any tag reference in the build command and then I was referencing 'polinux/httpd:centos', the base, in the run command.
Thanks.

Resources