i'm building jenkins pipline,one of the steps run's bash script, with few commands:
* gcloud --quiet auth configure-docker
* docker-compose -f ${DOCKER_COMPOSE_PATH} ${DOCKER_COMPOSE_CACHING_FILE} build ${SERVICE_NAME}
when i tried just running the script in the piplinet
/var/lib/jenkins/workspace/infrastructure-build/build.sh
i've got an error
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=gcr.io%2Fkycstation-production%2Fzkui&tag=stagingcache: dial unix /var/run/docker.sock: connect: permission denied
so i added "sudo" and than a new error have accured instead:
ERROR: (gcloud.auth.activate-service-account) Could not read json file gcloud-service-account-secret-key.json: No JSON object could be decoded
i have tried the next things: 1. created global variable in jenkins configuration 2. adding docker to root group 3. gcloud init
surfed the web, and still hadn't find anything that can help me