I have a Docker image that builds successfully but I am having issues when it tries to run my tests. Whenever my process gets to this step:
sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' $MY_BUILD_NAME)" -- bash -c gulp refresh
It returns with Exit code: 127 and says gulp command not found.
Normally if I click on EXEC in Kitematic (Docker GUI) it opens up a shell and I can run these commands just fine. But in this case its giving me “commands not found” issues.
Another thing I noticed is that if I cd into my /home/ directory, instead of running that gulp command, and run ls --the only directory I see is /ubuntu/ instead of /USERNAME/
It appears that its running the commands on the host and not in the container.
Here is my circle.yml file.
machine:
node:
version: 4.6.0
services:
- docker
post:
- echo "manual" | sudo tee /etc/init/mongod.override
- sudo service mongod stop
dependencies:
override:
- docker info
- docker build -t BUILD_NAME:latest .
test:
override:
- docker run -p 80:8080/tcp -p 8887:8887/tcp -p 27017:27017/tcp -it -d --name BUILDNAME -e ENV=linuxlocalhost -v $(pwd):/home/USERNAME/BUILD_NAME BUILD_NAME:latest bash
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' BUILDNAME)" -- bash -c pwd && ls && docker ps && gulp refresh