pythondockerdocker-imagedocker-pull

when pulling docker image and using it in my own image - does it stop at the last line?


I want to build my dockerfile top of this image. It's ubuntu + python. That 3rd party docker file:

FROM ubuntu:latest
MAINTAINER fnndsc "dev@babymri.org"

RUN apt-get update \
  && apt-get install -y python3-pip python3-dev \
  && cd /usr/local/bin \
  && ln -s /usr/bin/python3 python \
  && pip3 install --upgrade pip

ENTRYPOINT ["python3"] #this entry point line is my concern

But i want to use as a base for my own dockerfile:

FROM fnndsc/ubuntu-python3
RUN pip install enum34 llvmlite numba
RUN mkdir -p ./voice_flask/d
WORKDIR /voice_flask/d
COPY . /voice_flask/d

CMD ["python", "server.py"]

The question: the dockerfile of the base image stops at ENTRYpoint - but i dont need this entry point, i have my own last comand - 'CMD python server.py'.

Will that ENTRYPOINT affect my own dockerfile? Is that base dockerfile get executed and sits waiting at python shell?

EDIT: in other words, is that base dockerfile executed? or i just pull the image and my own dockerfile is built on top of it?


Solution

  • The Docker image you build will inherit the entrypoint from the base image unless you change it. If you are happy with the entrypoint then you don't need to do anything. CMD defines which arguments are passed to the entrypoint. If you are happy with the base entrypoint, python3, you can just have:

    CMD ["server.py"]
    

    in your Dockerfile.