Streamline your container workflow with Codefresh!

Codefresh CI/CD Pipeline QuickStart Guide

Docker Tutorial | June 30, 2017

Continuous Integration / Continuous Deployment (CI/CD) software is the backbone of the modern DevOps environment. CI/CD bridges the gap between your development and operations teams by automating build, test, and deployment of your applications.

This empowers developers to focus on creating the features end users need, and enables ops to effectively keep applications healthy.

The Modern Dockerized Microservice Architecture

Application development has shifted towards microservices. Microservices are collections of loosely coupled applications that, as a whole, serve the content of a typical monolithic legacy application. Applications deployed this way are extremely lightweight, more fault tolerant, easily scalable, and much easier to develop.

To create microservices, you break apart these massive monolith applications into their separable components. You can think of them as building blocks, like Legos. To serve your application, you combine each building block in the correct way. For example, your application might have a front-end GUI, a back-end database, and a caching system.

These building blocks are more commonly deployed as Docker containers. In a nutshell, Docker containers are a way to efficiently package your application and deploy on any operating system. With the almost instantaneous adoption of this technology, typical CI/CD software has struggled to keep up.

Codefresh is the first Docker-native CI/CD solution that seamlessly integrates with your organization’s workflow, and rapidly enables containerized builds for your microservices.

Create Your First Codefresh Pipeline In 5 Minutes

You can create your first Codefresh pipeline in minutes. We will create a basic pipeline that builds an image from a Dockerfile. See our basic pipeline guide for more advanced configuration options and use-cases.

Make sure that you meet the following prerequisites.

Step 0: Prerequisites

  1. Register for a GitHub, Bitbucket, or Gitlab account
  2. Fork this GitHub repository
  3. Register for a free Codefresh account

Step 1: Link Your Repository

codefresh create your first cicd pipeline

Creating your first Codefresh pipeline is extremely easy. In fact, creating the pipeline will take about 60 seconds. You can expect your first build to take anywhere from 1-3 minutes with subsequent builds going faster thanks to caching. .

The first step is to add your repository. You’ve already linked in your GitHub (or other SCM) account and cloned our sample repository. Select the DockerQuickStart repository, make sure you use branch develop and click next.

codefresh docker native cicd choose source repository github

 

Step 2: Choose Your Build Method

Codefresh will then ask you how to configure your pipeline’s build step. Click select under My Repo has a Dockerfile.

codefresh docker native cicd select build method dockerfile

Now you are given the option of picking which Dockerfile you want to build from. If your repository has multiple Dockerfiles, pick the appropriate one. Our Docker QuickStart repository only has a single Dockerfile.

codefresh docker native cicd select dockerfile

Step 3: Preview Configuration

Next, Codefresh displays the Dockerfile so you can verify the contents. Codefresh will use this Dockerfile to build your new image. Verify the contents of this Dockerfile are correct. Click “create” and your pipeline is ready!

codefresh docker native cicd preview dockerfile

Step 4: Build!

Now that your pipeline is ready, you can build. Click build to start the build process. The first build will take longer than usual because Codefresh is pulling all of the image layers required. Subsequent builds will be significantly faster because of Codefresh’s image layer caching.

codefresh docker native cicd pipeline created build

After a couple minutes have passed, your build we be completed. You can check it’s success by noting the ✅ symbol in the builds section.

Next Steps

Now that you’ve created your first Codefresh pipeline, integrated source code and built your first image, there is plenty more to do.

  • Add unit tests
  • Add integration tests
  • Customize the docker build command arguments
  • Push to a Docker registry (or keep things in the embedded registry)
  • Add a deployment
  • Configure environment variables
  • Test your application with environments for every commit

Docker Native CI/CD for Startups and Enterprise

Codefresh is the only enterprise-ready Docker native CI/CD solution built on Kubernetes in the market. Seamlessly build images to deploy your microservice applications. Sign up for a free Codefresh account to try it out for yourself. If you want a more in-depth tutorial, check out Getting Started – Create a Basic Pipeline for more configuration options.

About David Widen

Reader Interactions

Enjoy this article? Don't forget to share.

Follow me on Twitter