'Dockerfile build error on “RUN” command (no such image)

I do have this dockerfile where I’m trying to build a fairly simple desktop for kasm workspace, that has ciscopackettracer in it.

Any time I have a RUN Command after installing the package I will have image not found.

Whatever the command is, it will still give the same output.

Dockerfile:

FROM kasmweb/core-ubuntu-bionic:1.10.0
USER root

ENV HOME /home/kasm-default-profile
ENV STARTUPDIR /dockerstartup
ENV INST_SCRIPTS $STARTUPDIR/install
WORKDIR $HOME

######### Customize Container Here ###########

COPY ./resources/CiscoPacketTracer.deb $INST_SCRIPTS/resources/CiscoPacketTracer.deb
COPY ./resources/packettracer.logo.png $INST_SCRIPTS/resources/packettracer.logo.png

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils sudo

RUN apt-get upgrade -y

ARG DEBIAN_FRONTEND=noninteractive

RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
    echo PacketTracer   PacketTracer_810_amd64/accept-eula      boolean true | debconf-set-selections && \
    apt-get install -y $INST_SCRIPTS/resources/CiscoPacketTracer.deb && \
    rm -rf $INST_SCRIPTS/resources/

######### End Customizations ###########

RUN chown 1000:0 $HOME
RUN $STARTUPDIR/set_user_permission.sh $HOME

ENV HOME /home/kasm-user
WORKDIR $HOME
RUN mkdir -p $HOME && chown -R 1000:0 $HOME

USER 1000

Output:

# some successful output before this line…
Removing intermediate container 63d993c11caa
 ---> 1d4154f6ff32
Step 13/18 : RUN chown 1000:0 $HOME
No such image: sha256:1d4154f6ff32456e3f89deb159956658c6763714d5865dc3cfbae708f55a0609

I could move the chown to the previous RUN command (just like what I did with the remove command) but I wanna understand why the error is happening? Any thoughts?

And there are few things that may require me to run commands after, so I need to know the answer, thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source