python docker api how do we set the path environment variable?

  docker, dockerpy

I am trying to set the PATH environment variable inside the container using python docker api but doesnt seems to work , the container is not starting

does anybody has idea how to set the PATH env variable, other env variables works file.

I am seeing the below error
OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused “exec: “bash”: executable file not found in $PATH”: unknown

(exitCode, socConn) = self.container.exec_run('bash -e build/otin/BashCheckGCCVersion.sh',socket=True,environment=["PATH=/usr/lib64/ccache"]) 

 or


 environment=[
        "CCACHE_DIR=/work/.ccache",
        "PATH=/usr/lib64/ccache",
        "BUILDS_ALL_TIME=" + sys.argv[2],
        "PATCH_10.2=" + sys.argv[1]],
    working_dir="/OTINBuild",

Source: StackOverflow

LEAVE A COMMENT