Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple languages in docker container

I am trying to build a docker container where I can have both python and java on it, as well as some other tools like: make. I have tried using docker images from the internet as the base image for my image, however I would like to build my own custom image to the different specification I have. I am particularly interested in providing the image with multiple languages and tools to which my program can use.

like image 647
cruzhacker2020 Avatar asked Sep 19 '25 19:09

cruzhacker2020


1 Answers

You can install whatever you like in your container using the RUN command - as described in the Docker documentation: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run

If you look at the Dockerfile for an official Python image you can see that this is how Python is installed.

To create a Docker image with your own choice of tools you could start from a base image such as Debian or Ubuntu and install the languages of your choice.

However - I would not recommend this. As noted in the Docker best practices "each container should have only one concern", and the standard way of using Docker is to have one container run a single application using one language.

In your example you may have one Java-based container for one application, a separate Python-based on for your Python application and a third which contains build tools.

like image 149
bunnmatt Avatar answered Sep 22 '25 12:09

bunnmatt