Skip to content


This guide explains how to use Razorops to build a Docker image and push the image to Docker Registry. You need to add Dockerfile and add build configuration file to automate the process.

Preparing source files

You'll need some sample source code to build. In this section, you'll create a simple Hello World example and a Dockerfile.

  1. Create a file named with the following content:

    echo "Hello, world! The time is $(date)."

    Afterward, you can make it executable by running chmod +x in the shell.

  2. Create a file named Dockerfile with the following contents:

    FROM alpine
    COPY /
    CMD ["/"]
  3. Write Razorops YAML file

    In the same directory that contains above files, create .razorops.yaml file with the following content:

        - checkout
        - docker/build:
            image:  ## Name of docker image with registry
            push: true

    This config instructs Razorops to perform tasks based on your specifications.

Commit changes

Now add Dockerfile, and .razorops.yaml into git and push a commit to your Git provider, and you should be able to see a new workflow which builds you docker image and finally push to Docker registry.