Mount project folder using docker-compose and circle ci


Hi team,

I am trying to build my testing project in circle ci using docker -compose . I am able to build it successfully , but when I am trying to mount the project folder not able to do it.

Please find the error below

Circle ci config file

version: 2
      # using custom image, see .circleci/images/primary/Dockerfile
      - image: circleci/php:7.1.16

    working_directory: '~/project'

      - checkout
      - run: 'pwd'
      - run: 'ls'

      - setup_remote_docker:
           docker_layer_caching: true

      # This should go into custom primary image, here's only for the sake of explanation
      - run:
          name: Install Docker client
          command: |
            set -x
            curl -L -o /tmp/docker-$VER.tgz$VER.tgz
            tar -xz -C /tmp -f /tmp/docker-$VER.tgz
            sudo mv /tmp/docker/* /usr/bin
      - run:
          name: Install Docker Compose
          command: |
            set -x
            curl -L`uname -s`-`uname -m` > ~/docker-compose
            #sudo curl -L`uname -s`-`uname -m` > /usr/local/bin/docker-compose
            #sudo chmod +x /usr/local/bin/docker-compose   
      - run:
          name: Start container and verify it's working
          command: |
            set -
            ls -latr
            ls -ltr
            docker-compose build testing-suite
            docker-compose up       

Docker file

FROM platform/environments:php7.1-centos7

RUN yum clean all

RUN yum install -y openssl-dev epel-release php-pear php-devel php-libsodium gd gd-devel php-gd

RUN pecl install mongodb

# install libsodium, mongodb gd
RUN echo "" >> /etc/php.ini
RUN echo 'date.timezone="America/Detroit"' >> /etc/php.ini

#WORKDIR "/testing-suite"
WORKDIR "/project"

Docker-compose file

    version: '3'

              context: ./Docker

           # working_dir: /testing-suite
            command: "./bin/run beta chrome checkAllLinks update"
                #- "${HOST_PATH_SRC_TEST_SUITE}:/testing-suite"
                - .:/project
                - selenium-chrome

            image: selenium/standalone-chrome:3.5.3
                - /dev/shm:/dev/shm
                - "4444:4444"


Are you sure ./bin/run exists? Maybe you could change this to a fully-qualified path, in order to make it more resilient?


I already tried by changing to full path . the problem is circle ci could not mount my project folder to the docker container created .


Ah, right. I wonder if you’re bumping into this problem? It comes up quite regularly here.


If you’re using Docker volumes, which it looks like so in the Docker Compose file, then you’d want to use the machine executor not the docker executor`.


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.