I'm developing an application using java. In my Dockerfile, I'm using openjdk:11.0.1-jdk-slim-stretch as my parent image. The problem arose when I needed to add a python script to do a specific job for my app (the app executes the script using Runtime.getRuntime().exec()). This works fine in my local machine because I have python installed but I need to deploy this app soon. How can I install python in my parent image?
Asked
Active
Viewed 1,263 times
0
-
See if this helps: https://stackoverflow.com/questions/47216784/how-to-install-python-in-a-docker-image – Bitswazsky Aug 13 '20 at 08:11
-
I tried doing this and the error returned said that 'sudo' not found and error code 127. – Ryan Aug 13 '20 at 08:37
-
Do you need a concrete version of python or latest? – Alejandro Galera Aug 13 '20 at 09:05
-
Any python that will work in Linux 1 – Ryan Aug 13 '20 at 09:25
-
You don't need `sudo` in Docker (usually at all): in a Dockerfile you're probably already root, and if not, you can specify `USER root`. – David Maze Aug 13 '20 at 10:53