jib icon indicating copy to clipboard operation
jib copied to clipboard

Hi, I am trying to call the python script from Spring boot Java application which is containerized with Google Jib.

Open NitinSharma1991 opened this issue 1 year ago • 3 comments

I am trying to call a python script for some business purposes which is containerized with Google Jib. I would like to know how can I copy python into the jib if it's possible , so that it will allow me to call the script from the application itself.

NitinSharma1991 avatar Feb 13 '24 14:02 NitinSharma1991

I copy shell file like this:

jib {
...
        extraDirectories {
            paths {
                path {
                    from = file('docker/files')
                    into = '/'
                    includes = ['entrypoint.sh']
                }
            }
            permissions = [
                    '/entrypoint.sh'     : '755',
            ]
        }
}

igouss avatar Feb 14 '24 20:02 igouss

This is just to copy the script file. How about copy python executable to run python script as a process.

NitinSharma1991 avatar Feb 15 '24 04:02 NitinSharma1991

@NitinSharma1991 similar to what was described above, to make Python binaries available to your Java application within the container, you can use Jib's extraDirectories feature to copy them into the desired location. This Maven and Gradle doc explains how you can add arbitrary files to the jib container (the python binary can be added the same way). By default, the file will be copied onto the src/main/jib directory but the destination can be customized as instructed in the links attached.

mpeddada1 avatar May 10 '24 19:05 mpeddada1

Closing as there is no followups from issue reporter. Feel free to reopen if you still have questions on this topic.

zhumin8 avatar Aug 02 '24 18:08 zhumin8