I'm trying to start a container in TravisCI and then just making some docker exec
to it. But it's failing everytime with 255 error code.
What I don't understand is that the process works fine locally.
I then updated my travisCI script to something very simple with standard container (ubuntu). The same is happening.
I just pull an image, run it with a no end while, and try to execute some exec to it. I use a file container_id
to store the container id (that part works).
Here is my code :
$ docker pull ubuntu:latest
latest: Pulling from ubuntu
age you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Status: Downloaded newer image for ubuntu:latest
$ docker run -d ubuntu:latest sh -c "while true; do sleep 5; done" > container_id
The command "docker run -d ubuntu:latest sh -c "while true; do sleep 5; done" > container_id" exited with 0.
$ docker logs `cat container_id`
The command "docker logs `cat container_id`" exited with 0.
$ docker exec `cat container_id` sh -c "mkdir /repository"
The command "docker exec `cat container_id` sh -c "mkdir /repository"" exited with 255.
$ docker logs `cat container_id`
The command "docker logs `cat container_id`" exited with 0.
$ docker exec `cat container_id` sh -c "cd /repository ; git clone https://github.com/tdeheurles/homecores"
The command "docker exec `cat container_id` sh -c "cd /repository ; git clone https://github.com/tdeheurles/homecores"" exited with 255.
$ docker logs `cat container_id`
The command "docker logs `cat container_id`" exited with 0.
$ docker exec `cat container_id` sh -c "cd /repository/homecores ; ./test/test.sh"
The command "docker exec `cat container_id` sh -c "cd /repository/homecores ; ./test/test.sh"" exited with 255.
$ docker logs `cat container_id`
The command "docker logs `cat container_id`" exited with 0.
Done. Your build exited with 1.