DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Navigating Kubernetes With Helm 3 Charts and ChartCenter
  • Why Camel K?
  • An Introduction to BentoML: A Unified AI Application Framework
  • How To Use the Node Docker Official Image

Trending

  • Three Ways AI Is Reshaping DevSecOps
  • Snowflake vs. Data Bricks: Compete To Create the Best Cloud Data Platform
  • Monetizing APIs: Accelerate Growth and Relieve Strain on Your Engineers
  • How To Start a Successful Career in DevOps
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Automating Application Releases With Docker

Automating Application Releases With Docker

Learn some first steps on the path to automating your application releases using Docker and Jenkins.

Tracy Kennedy user avatar by
Tracy Kennedy
·
Sep. 16, 15 · Opinion
Like (2)
Save
Tweet
Share
3.38K Views

Join the DZone community and get the full member experience.

Join For Free

docker-whale-sea.jpg

Many organizations struggle with releasing their applications and this struggle has birthed an industry of tools designed to simplify the process.  Release management tools allow a release process to be defined as stages in a pipeline, and stages themselves contain sequential steps to be performed before the next begins. Stages are segmented using approval gates to ensure that QA and release managers get the final say on whether an artifact is ready for the next stage in the release pipeline, and the entire process is tracked for reporting purposes.

The goal of such processes is to ensure that only high quality releases are deployed into production and are released on time, and the release manager is responsible for it all.

An obstacle to a smooth release is the structural challenge of maintaining identical testing and production environments. When these environments differ, it allows an opportunity for unexpected regressions to slip through testing and botch a release. Ideally, all environments will be identical and contain the same dependent libraries and tooling for the application, as well as the same network configurations.

What is Docker?

Docker is an open-source project that provides a platform for building and shipping applications using containers. This platform enables developers to easily create standardized environments that ensure that a testing environment is the same as the production environment, as well as providing a lightweight solution for virtualizing applications.

Docker containers are lightweight runtime environments that consist of an application and its dependencies. These containers run “on the metal” of a machine, allowing them to avoid the 1-5% of CPU overhead and 5-10% of memory overhead associated with traditional virtualization technologies. They can also be created from a read-only template called a Docker image.  

Docker images can be created from an environment definition called a Dockerfile or from a running Docker container which has been committed as an image. Once a Docker image exists, it can be pushed to a registry like Docker Hub and a container can be created from that image, creating a runtime environment with a guaranteed set of tools and applications installed to it. Similarly, containers can be committed to images which are then committed to Docker Hub.

Cookie-cutter environments and application packaging The versatility and usability of Docker has made it a popular choice among DevOps-driven organizations. It has also made Docker an ideal choice for creating the standardized and repeatable environments that an organization needs for both creating identical testing and production environments as well as for packaging portable applications.

If an application is packaged in a Docker image, testing and deploying is a matter of creating a container from that image and running tests against the application inside. If the application passes the tests, then they should be stored in a registry and eventually deployed to production.

Automating the release According to Forrester Research, the top pain of release management is a lack of visibility into the release management process and their process’ lack of automation.


However, the testing, deploying, and releasing stages of these pipelines can be orchestrated by Jenkins using the CloudBees Docker Build and Publish plugin . This plugin creates a new build step for building and packaging applications into Docker containers, as well as publishing them a images to both private and public Docker registries like Docker Hub. Screen Shot 2015-06-10 at 1.57.06 PM.png


Testing and QA Applications packaged in Docker images can be tested by running them as a container. Docker allows containers to be linked, granting the linked container shell access and allowing it to run scripts against the application’s container. This link can also be made between the Docker application container and another container which is packaging a service the application needs to run against for a true integration test, such as a test database.

Promotion and Release Jenkins supports the concept of promotion, where tested and approved artifacts are promoted to the next stage in a pipeline. Promotion is compatible with both traditional Jenkins jobs and the new Jenkins Workflow , and promotions can be set to only trigger if manually approved by particular users or team members.

In this case, the artifact is a Docker image containing our application, and once it  is promoted it can be manually or automatically moved to the next stage of its pipeline. The next stage can range from a pre-production staging area to a registry like Docker Hub, where the promoted image is known as a “Gold” image ready for deployment.

The promotion can also trigger any other number of pre-release actions, such as notifications and sending data about the artifact to a company dashboard.

Where do I start?

  1. The CloudBees Docker Build and Publish plugin is an open-source plugin, so it is available for download from the open-source update center or packaged as part of the CloudBees Jenkins Platform. 
  2. More information can be found in the newly released Jenkins Cookbook
  3. Other plugins complement and enhance the ways Docker can be used with Jenkins. Read more about their uses cases in these blogs:
  4. Docker Slaves with the CloudBees Jenkins Platform
  5. Jenkins Docker Workflow DSL
  6. Docker Traceability
  7. Docker Hub Trigger Plugin
  8. Docker Custom Build Environment plugin
Docker (software) application Release (agency)

Published at DZone with permission of Tracy Kennedy, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Navigating Kubernetes With Helm 3 Charts and ChartCenter
  • Why Camel K?
  • An Introduction to BentoML: A Unified AI Application Framework
  • How To Use the Node Docker Official Image

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: