Skip to content
/ dcind Public
forked from meAmidos/dcind

Docker image with Docker Compose. Useful as a base image for integration tests in Concourse CI.

License

Notifications You must be signed in to change notification settings

buildo/dcind

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Concourse Docker-Compose-in-Docker

Optimized for use with Concourse CI.

The image is Alpine based, and includes Docker and Docker Compose, as well as Bash.

This image is an updated version of karlkfi/concourse-dcind.

Inspired by meAmidos/dcind, concourse/docker-image-resource, and mesosphere/mesos-slave-dind.

Example

Here is an example of a Concourse job that uses buildo/dcind image to run a bunch of containers in a task, and then runs the integration test suite.

jobs:
  - name: integration
    plan:
      - get: code
        params:
          depth: 1
        passed:
          - unit-tests
        trigger: true
      - get: redis
        params: { save: true }
      - get: busybox
        params: { save: true }
      - task: integration-tests
        privileged: true
        config:
          platform: linux
          image_resource:
            type: docker-image
            source:
              repository: buildo/dcind
          inputs:
            - name: code
            - name: redis
            - name: busybox
          run:
            path: entrypoint.sh
            args:
              - bash
              - -ceux
              - |
                # Strictly speaking, preloading of images is not required.
                # However you might want to do it for a couple of reasons:
                # - If the image is from a private repository, it is much easier to let concourse pull it,
                #   and then pass it through to the task.
                # - When the image is passed to the task, Concourse can often get the image from its cache.
                docker load -i redis/image
                docker tag "$(cat redis/image-id)" "$(cat redis/repository):$(cat redis/tag)"
                docker load -i busybox/image
                docker tag "$(cat busybox/image-id)" "$(cat busybox/repository):$(cat busybox/tag)"
                # This is just to visually check in the log that images have been loaded successfully
                docker images
                # start containers
                docker-compose -f code/example/integration.yml run tests
                # stop and remove containers
                docker-compose -f code/example/integration.yml down
                # remove volumes
                docker volume rm $(docker volume ls -q)

About

Docker image with Docker Compose. Useful as a base image for integration tests in Concourse CI.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 85.9%
  • Dockerfile 14.1%