Skip to content

Working with Docker environment

Razorops has out of the box support for running most Docker commands, building Docker images, and can also push images to Docker repositories, such as Docker Hub, as part of your continuous integration (CI) workflow. You run execute Docker CLI or Docker-Compose commands within task steps or use inbuild docker actions.

The Docker-based environment is a composable environment where you can customize it with one or more containers. You can use any Docker image maintained at Razorci - available for most programming languages and frameworks, or your own private image.

Example

To use Docker environment, you should specify atleast one container image in global.runner or in tasks.<task-id>.runner -

global:
  runner: razorci/img

tasks:
  build-image:
    steps:
    - run: git --version
tasks:
  build-image:
    runner: razorci/img
    steps:
    - run: git --version

Using Docker daemon

Each workflow run gets it's own docker daemon, connected and capable of executing your Docker commands in the pipeline. All containers share the same network interface and started/stopped automatically alongside your pipeline.

Note:

  • Currently, we only supports Docker 19.03. If you need specific version of Docker, please contact our support.
  • The runner and the Docker daemon is a separate environments if you are using Docker based environment (Docker in Docker use case). The Daemon will run be running locally for Linux VM environment though.

Note

For better performance, we recommend you use VM based environment for building docker/container images.

Layer caching

Docker uses a layer cache to optimize the process of building Docker images and make it faster. If your Dockerfile and related files haven't changed, a rebuild can reuse some of the existing layers in your local image cache.

All type of accounts except on free tier, gets layer caching enabled in your pipelines. To more details, see "Docker Layer Caching".