set linker in docker image made by jib java

  docker, java, jib, linker

Ok, I encountered linking problems while creating jib docker image.
I copy the files i want into container

jib {
    allowInsecureRegistries = true
    extraDirectories{
        paths{
            path{
                from = file('jnetpcap/jib')
                into = '/native'
            }
        }   
    }
.
.
.

and in other task, i point to those libraries

task cmdScript(type: CreateStartScripts) {
    mainClassName = "cic.cs.unb.ca.ifm.Cmd"
    applicationName = "cfm"
    outputDir = new File(project.buildDir, 'scripts')
    classpath = jar.outputs.files + project.configurations.runtime
    defaultJvmOpts = ["-Djava.library.path=/native"]
}

I checked, and those libraries are added correctly to container. It is not a problem withy copying libs, but setting up linker.

cmdScript sets correct linker if i build project with distTar, but i don’t know how to set up linker when building it with jibDockerBuild.
I couldn’t find anwer to my issue here so decided to seek help on SF.

Source: Docker Questions

LEAVE A COMMENT