I have made a script task to run during a build and it should build and start some docker containers based on dockerfiles but it gives me the following error:
Building proxy...
Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
I have made some tests accessing ec2 instance and trying to run simple docker commands like
docker ps
When I run as bamboo or ec2-user user
su - bamboo -c "docker ps"
# or
su - ec2-user -c "docker ps"
it shows me the error:
su - bamboo -c "docker ps"
2015/02/09 12:34:05 Get http:///var/run/docker.sock/v1.14/containers/json: dial unix /var/run/docker.sock: permission denied
su - ec2-user -c "docker ps"
2015/02/09 12:34:05 Get http:///var/run/docker.sock/v1.14/containers/json: dial unix /var/run/docker.sock: permission denied
When I run as root it runs normally:
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
What should I do to run this script?