Coder Social home page Coder Social logo

cioplenu / dcind Goto Github PK

View Code? Open in Web Editor NEW

This project forked from netresearch/dcind

0.0 2.0 0.0 64 KB

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

Home Page: https://hub.docker.com/r/netresearch/dcind/

License: MIT License

Dockerfile 6.52% Shell 93.48%

dcind's Introduction

dcind (Docker-Compose-in-Docker)

Versioning

This repository and corresponding images on Docker Hub follow the semantic versioning rules. It is advised to not rely on the latest tag when using amidos/dcind image in your CI pipelines. Consider using a specific version, like amidos/dcind:1.

Usage

Use this Dockerfile to build a base image for your integration tests in Concourse CI. Alternatively, you can use a ready-to-use image from the Docker Hub: amidos/dcind. The image is Alpine based.

Here is an example of a Concourse job that uses netresearch/dcind image to run a bunch of containers in a task, and then runs the integration test suite. You can find a full version of this example in the example directory.

Note that docker-lib.sh has bash dependencies, so it is important to use bash in your task.

  - name: integration
    plan:
      - aggregate:
        - get: code
          params: {depth: 1}
          passed: [unit-tests]
          trigger: true
        - get: redis
          params: {save: true}
        - get: busybox
          params: {save: true}
      - task: Run integration tests
        privileged: true
        config:
          platform: linux
          image_resource:
            type: docker-image
            source:
              repository: amidos/dcind
          inputs:
            - name: code
            - name: redis
            - name: busybox
          run:
            path: bash
            args:
              - -exc
              - |
                source /docker-lib.sh
                start_docker

                # Strictly speaking, preloading of Docker images is not required.
                # However, you might want to do this for a couple of reasons:
                # - If the image comes 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)"

                message info This is just to visually check in the log that images have been loaded successfully
                docker images

                message Run the container with tests and its dependencies.
                docker-compose -f code/example/integration.yml run tests

                message header Cleanup.
                message info Not sure if this is required. It's quite possible that Concourse is smart enough to clean up the Docker mess itself.
                docker-compose -f code/example/integration.yml down
                docker volume rm $(docker volume ls -q)

Included tools

Messages

For better organized log files, this image provides commands on the CLI for a colourful output:

message info "Short info message"

message header "Big headline with deviders"

message error 418 "Error message with exit code"

message warn "Use it when something goes wrong"

message ok "Use it for successful processes"

message code "<example>My exaple code</example>"

dcind's People

Contributors

meamidos avatar cybottm avatar anianz avatar vergissberlin avatar smolevich avatar loco8878 avatar gmile avatar jamestoyer avatar samuelweibel avatar stefanwork avatar fenech avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.