Could not parse reference error

Hi,
I am trying to build a docker image of my product using Kaniko, on a Rancher RKE2 k8s cluster via Jenkins. I am cloning repo inside pod on a k8s cluster and executing Kaniko to build the image. In the kaniko stage I am getting below error:
Retrieving image manifest :
error building image: could not parse reference: :
Need help in debugging this issue.

Here is my Dockerfile:

ARG BASE_IMAGE
ARG BASE_IMAGE_VERSION

FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION}
WORKDIR /app
RUN apt-get update && apt-get install -y nfs-common python3-pip \
    && rm -rf /var/lib/apt/lists/* && \
    apt clean

# We copy just the requirements.txt first to leverage Docker cache
COPY requirements_cmn.txt /app/
COPY requirements.txt /app/

RUN pip3 install --upgrade pip
RUN pip3 install --no-cache-dir -r /app/requirements.txt

#should copy the dependent library as well
COPY . /app
RUN chmod +x /app/start_saas_app.sh
ENV PYTHONPATH=/app
EXPOSE 80
CMD ["/app/start_saas_app.sh"]

Did you give args to docker build? If not then BASE_IMAGE and BASE_IMAGE_VERSION will be empty, and the image reference will be :

e.g.

docker build --build-arg BASE_IMAGE=nginx  --build-arg BASE_IMAGE_VERSION=latest ...`
1 Like

Aah…that was the mistake!! I was not passing build-arg.
Thanks a lot for pointing out it.