Why are valid directives in my Dockerfile apparently being ignored?
It looks like your Dockerfile is attempting a multistage build:

FROM ubuntu:latest
...
FROM python:2.7
...


This is a feature that enables you to build parts of your image in a separate build container and then import what you need. Unless you import stuff into your end container, it will be lost in the build process; this is exactly what is happening with your RUN apt-get... statement. To fix it, try removing the extra stages of the build, (FROM ubuntu:latest and FROM python:2.7) and moving your commands to after FROM cassandra:3.11.4 like so:

FROM cassandra:3.11.4

USER root

RUN apt-get -y update \
    &amp;&amp; apt-get -y upgrade \
    &amp;&amp; apt-get install -y \
        python-pip \
        nmap \
        vim-tiny

RUN pip install --no-cache-dir cassandra-driver
...


I'm sorry you're having a hard time with Docker. Hopefully this helps and it starts making more sense. Good luck, friend!