How to get code checkout when primary container is in private repo


#1

Hi there,

I have the following in my circle.yml. It works ‘fine’ (in terms of services etc), except the code I’m running is code baked into the docker image. I understand that ‘checkout’ checks out code into the primary image but I can’t work out my remote private image can become the primary container.

version: 2
jobs:
  build:
    working_directory: /app
    docker:
      - image: docker:stable-git
   steps:
     - checkout
     - setup_remote_docker
     - run:
       name: Install dependencies
       command: |
         apk add --no-cache py-pip bash
         pip install docker-compose
     - run:
       name: Authenticate so can pull base img
       command: |
         docker login -u $DOCKER_USER -p $DOCKER_PASS
     - run:
       name: Start service containers and run tests
       command: |
         docker-compose up -d db es redis
         docker ps
         docker run --network container:app_db_1 -it private/repo:v1 /bin/bash -c "cd myDir && python manage.py test"

In another attempt to try make this work, I used docker-compose to build a new image based off the image in the private repo (thus cutting down on build time) but again I hit the problem of trying to checkout my code in this newly built image.

Am I approaching this the wrong way? Is this possible somehow?!

Thanks in anticipation,


#2

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