Docker Community Forums

Share and learn in the Docker community.

Executing a binary file in docker which is in the PATH

docker

(Mahmood) #1
    0
    down vote

    favorite

Inside a Docker image, I have added some executable files to the
PATH. However, I am not able to run them without their absolute path.

$ docker exec -it master bash
root@master:/var/lib/docker/aufs/mnt/ea3028d12a2805542dc16e6f1035972f0bcb470ac5b876db78b8b1149ef826b1# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/jdk/bin:/opt/new_analytic/hadoop-2.7.1/bin:/opt/new_analytic/hadoop-2.7.1/sbin:/opt/new_analytic/apache-maven-3.3.3:/opt/new_analytic/apache-maven-3.3.3/bin:/opt/new_analytic/apache-mahout-distribution-0.11.0:/opt/new_analytic/apache-mahout-distribution-0.11.0/bin
root@master:/var/lib/docker/aufs/mnt/ea3028d12a2805542dc16e6f1035972f0bcb470ac5b876db78b8b1149ef826b1# ls -l opt/new_analytic/hadoop-2.7.1/bin/hdfs
-rwxr-xr-x 1 10021 10021 12223 Jun 29 2015 opt/new_analytic/hadoop-2.7.1/bin/hdfs
root@master:/var/lib/docker/aufs/mnt/ea3028d12a2805542dc16e6f1035972f0bcb470ac5b876db78b8b1149ef826b1# hdfs
bash: hdfs: command not found
root@master:/var/lib/docker/aufs/mnt/ea3028d12a2805542dc16e6f1035972f0bcb470ac5b876db78b8b1149ef826b1#

Note that opt/new_analytic/hadoop-2.7.1/bin/hdfs is in the PATH variable. What is the mistake here?