Hello,
I have problem in circleci jobs. I have configure my circleci to bitbucket so when I push the changes then a job created in circleci but it thors following error :
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I have attached screenshot also for that.
When I run the command : circleci local execute in my terminal then it execute successfull…!
My config.yml code is here:
version: 2
jobs: # a collection of steps
build:
docker:
- image: circleci/php:7.0.22-apache-node #
environment:
IMAGE_NAME: adilkadiyawala/uc2:tagname
IMAGE: uc2-test
DOCKERHUB_PASS: PASSWORD
DOCKERHUB_USERNAME: username
working_directory: ~/app # directory where steps will run
steps: # a set of executable commands
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build Docker image
command: |
sudo docker build --file .docker/Dockerfile -t uc2-test .
no_output_timeout: 35m
- run:
name: Publish Docker Image to Docker Hub
command: |
IMAGE_TAG="0.0.${CIRCLE_BUILD_NUM}"
sudo docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASS
sudo docker tag $IMAGE:latest $IMAGE_NAME
sudo docker push $IMAGE_NAME
- persist_to_workspace:
root: ~/app
paths:
- "vendor"
- "generated"
- "pub/static"
- "var/view_preprocessed"
- "image.tar"
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
- deploy-staging:
requires:
- build
filters:
branches:
only: staging