Docker Community Forums

Share and learn in the Docker community.

Docker fail to expand with subshell in Makefile

docker

(Avm003257) #1

Hi, I am using Docker as a faster Virtual Machinesm to build for embedded systems.

In Makefile, I see problems in evaluating/expanding subshell. The following statement can’t return a right , current path:

BASE_INSTALL_DIR := $(shell pwd)/…

Thus, all the following statements go wrong:

TOOLS_INSTALL_DIR := $(BASE_INSTALL_DIR)/tools
SDK_INSTALL_DIR := $(BASE_INSTALL_DIR)/sdk

The message goes like:
make[1]: pwd: Command not found

How should I resolve all this issue?


(Avm003257) #2

This issue can be solved by setting current directory into $PATH. Two ways to solve:

  1. Write a Dockerfile to build an image. Include a line “ENV PATH $PATH:.
  2. Run a container and manually execute “export PATH=$PATH:.