Docker: base image for a Java+Python application

Viewed 1444

I'm preparing a docker image for an application that includes both Java and Python components. There are a few ways to go about the base image, and I was wondering if there's one "correct", or canonical way:

  1. Start from a JDK image and add Python using apt-get
  2. Start from a Python image and add JDK using apt-get
  3. Start from a minimal Ubuntu/Debian/CentOS and add Python and OpenJDK using apt-get/yum

I can't think of even one reason to prefer #1 over #2 or vice-versa; however, I believe #3 will include many things I don't need.

EDIT while the question at Dockerfile from python:3.6-slim add jdk8 has two possible solutions, I was looking to know if there's a best practice, or canonical answer.

0 Answers
Related