Create your FREE Codefresh account and start making pipelines fast. Create Account

Tools for Deploying Docker to Kubernetes, Swarm, ECS and more…

2 min read

One of the unique aspects of Codefresh’s pipelines is that each step runs in it’s own container. This means adding a custom step is as easy as calling in a Docker image. We’ve created a number of images to make it easy to deploy.

Kubernetes Deploy Tools

If you’re using Codefresh, the Kubernetes deployment step can be configured through the UI and will generate a YAML pipeline step that looks similar to this:

    title: Running Deploy Script
    type: deploy
    kind: kubernetes
    cluster: cluster-1@FirstKubernetes
    namespace: demochat
          - master
    service: demochat-prod

We’ve done this to simply interactions with deployment. If you want to work directly with the image, either on your own local machine, or in another tool you can snag the image from Docker hub.

Swarm Deploy Tools

Docker Swarm is defined using the docker-compose  format and is beloved for it’s ease of use, especially for local development. Codefresh provides a helper image for deploying to Swarm as well as a built-in environment for testing applications.

The YAML step for calling the Swarm deploy image looks like this

    image: codefresh/remote-docker
    working_directory: ${{main_clone}}
      - rdocker ${{RDOCKER_HOST}} docker stack deploy --compose-file docker-stack.yml ${{STACK_NAME}}
      - SSH_KEY=${{SSH_KEY}}
          - master

Where the ${{}} refer to variables defined for a pipeline.

You can read more about using this image in our documentation.

ECS Deploy Tools

Amazon Elastic Container Service is one of the most popular ways containers are deployed into production today. If you’re using Codefresh to deploy your containers, you can select the ECS deploy image in the UI. It will add a step that looks like this to your YAML

deploy to ecs:
    image: codefresh/cf-deploy-ecs    # the name of the Codefresh docker image (not your image)
      - cfecs-update --image-name <image-fullname-without-tag> --image-tag '${{CF_BRANCH}}' <aws-region> <ecs-cluster-name> <ecs-service-name>
  *     environment:

          - master

To use this image yourself, or learn more about how it works, check out our documentation.

Helm Deploy Tools

Helm is a Kubernetes package manager. It’s much more powerful that something like Docker-compose. This image offers a few advantages over just running helm install <chart name>. In addition to automatically installing Tiller it also has some tooling for parsing json which really valuable if you want to parse secrets and copy them to other namespaces.

Here’s the documentation.

New to Codefresh? Get started with Codefresh by signing up for an account today!

Dan Garfield

Dan is the Co-Founder and Chief Open Source Officer at Codefresh. His work in open source includes being an Argo Maintainer, and co-chair of the GitOps Working Group. As a technology leader with a background in full-stack engineering, evangelism, and communications, he led Codefresh's go-to-market strategy and now leads open source strategy. You can follow him at