How to modify default docker base image during deployment of Azure Kubernetes service

10/2/2020

I have been using DEFAULT_GPU_IMAGE as my base image in Azure ML but now it started throwing the ImportError: libGL.so.1: cannot open shared object file: No such file or directory error when importing opencv. Some answers here on stackoverflow say i need to run apt-get update on the image. specifically:

RUN apt-get update ##[edited] 
RUN apt-get install 'ffmpeg'\
'libsm6'\ 
'libxext6'  -y

Would you know where can i find the docker file to add the lines to or is there a way to patch the image during the deployment of the AKS service? (same way as pip and conda packages are possible to be installed during the deployment)

-- Chris
azure
azureml
docker
kubernetes
opencv

1 Answer

10/2/2020

The base images for AzureML containers can be found in this github project. This page also contains detailed documentation for the images.

Alternatively you can use "docker inspect" to get details of the image.

For example: docker inspect mcr.microsoft.com/azureml/base-gpu:latest

Then in the base image like this dockerfile just add packages you need along with other dependencies like in this:

    # custom packages <------
    apt-get install -y \
    ffmpeg \ 
    libsm6 \ 
    libxext6 && \
# Install Common Dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    # SSH and RDMA
    libmlx4-1 \
    libmlx5-1 \
    librdmacm1 \
    libibverbs1 \
    libmthca1 \
    libdapl2 \
    dapl2-utils \
    openssh-client \
    openssh-server \
    iproute2 && \
    # custom packages <------
    apt-get install -y \
    ffmpeg \ 
    libsm6 \ 
    libxext6 && \
    # Others
    apt-get install -y \
    build-essential \
...
-- Piotr Malec
Source: StackOverflow