cruzhacker2020
cruzhacker2020

Reputation: 53

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.

Upvotes: 3

Views: 6408

Answers (1)

bunnmatt
bunnmatt

Reputation: 817

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.

Upvotes: 3

Related Questions