Accelerate the CI/CD pipe using the new AWS Codebuild Docker Server | Amazon Web Services

Polly expressed

From today you can use the AWS Codebuild Docker Server server to provide a dedicated and persistent Docker server directly within your Codebuild project. With the Docker Server server, you can speed up the Docker Figure report by centralizing images on a remote host, which shortens the waiting times and increases overall efficiency.

From my benchmark, with this Docker Server server, I will shorten the total building time by 98 pierients, from 24 minutes and 54 seconds to 16 seconds. Here is a quick view of this feature from my AWS Codebuild projects.

AWS Codebuild is a fully managed service of continuous integration that compile the source code, launches tests and creates software packages ready to deploy. Building Docker images is one of the most common cases for Codebuild customers, and the service has gradually improved this experience over time using Reatures, such as Docker documentation documents and reserved capacity functions to improve Docker assembly.

With the new Docker server capability, you can shorten the assembly time for your Persistent Docker Server server with the cache. If it is allowed in the Codebuild project, the dedicated Docker server is ensured by the persistent storage that maintains the Docker layer cache. This server can process multiple competitors operations Docker Build, with all reports from the same centralized cache.

Using AWS Codebuild Docker Server
Let me go through a demonstration that represents the benefits with the new Docker server.

For this demonstration, I build a complex, multilayer picture of Docker based on formal AWS Codbuild curatorial pictures Docker Images Restilion, especially Dockerfile to create a standard picture Ubuntu. This image contains a number of addictions and tools needed for modern pipes of continuous integration and continuous delivery (CI/CD), making it a good example of the type of large buildings that the development teams regularly perform.


# Copyright 2020-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use this file except in compliance with the License.
# A copy of the License is located at
#
#    http://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file.
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
# See the License for the specific language governing permissions and limitations under the License.
FROM public.ecr.aws/ubuntu/ubuntu:20.04 AS core

ARG DEBIAN_FRONTEND="noninteractive"

# Install git, SSH, Git, Firefox, GeckoDriver, Chrome, ChromeDriver,  stunnel, AWS Tools, configure SSM, AWS CLI v2, env tools for runtimes: Dotnet, NodeJS, Ruby, Python, PHP, Java, Go, .NET, Powershell Core,  Docker, Composer, and other utilities
COMMAND REDACTED FOR BREVITY
# Activate runtime versions specific to image version.
RUN n $NODE_14_VERSION
RUN pyenv  global $PYTHON_39_VERSION
RUN phpenv global $PHP_80_VERSION
RUN rbenv  global $RUBY_27_VERSION
RUN goenv global  $GOLANG_15_VERSION

# Configure SSH
COPY ssh_config /root/.ssh/config
COPY runtimes.yml /codebuild/image/config/runtimes.yml
COPY dockerd-entrypoint.sh /usr/local/bin/dockerd-entrypoint.sh
COPY legal/bill_of_material.txt /usr/share/doc/bill_of_material.txt
COPY amazon-ssm-agent.json /etc/amazon/ssm/amazon-ssm-agent.json

ENTRYPOINT ("/usr/local/bin/dockerd-entrypoint.sh")

This dockerfile creates an environment with an understanding of assembly with multiple programming languages, assembly tools and addiction – exactly the type of image that would benefit from the persistent storage in the cache.

In the assembly specification (BuildSpec) I use docker buildx build . Command:

version: 0.2
phases:
  build:
    commands:
      - cd ubuntu/standard/5.0
      - docker buildx build -t codebuild-ubuntu:latest .

To enable Docker’s ability to go to the AWS Codebuild console and select Create a project. I can also this ability when adjusting existing Codebuild projects.

I fill in all the details and configuration. IN Environment Sections, I will choose Another configuration.

Then I go down and find Docker Configuration and choose Enable Docker Server for this project. When I select this option, I can select Compute configuration for Docker. When I end up with configurations, I will create this project.

Now let’s look at the ability of the Docker server in action.

The initial assembly takes approximately 24 minutes and 54 seconds because they have to download and all dependencies from scratch. This is expected for the first assembly of such a complex image.

For the following assemblies without code changes, the assembly takes only 16 seconds, and this indicates a 98% reduction in the assembly time.

Looking at the protocols, I see that with the docker server most layers are pulled out of permanent cache:

The persistent storage in the cache provided by the Mainers server Docker Server all layers between reports, which is especially valuable for large, complex Docker images with many layers. This shows how the Docker server can dramatically improve the throughput for teams that will build a number of docker buildings in their CI/CD pipes.

Other things to know
Here are a few things that you can note:

  • Support for architecture – This feature is available for assembly X86 (Linux) and ARM.
  • Prices – If you want to learn more about prices for the ability of Docker server, Fer on the AWS Codebuild page.
  • Availability – This feature is available in all AWS regions where AWS Codebuild is offered. For more information about the AWS regions where Codebuild is available, see AWS Regions.

You can learn more about the Docker Server server function in the AWS Codebuild documentation.

Happy building! –

Donnie prakoso


How’s the Blog of news? Take this 1 minute survey!

(This survey is hosted by an external company. AWS processes your information as described in the AWS Privacy Notice. AWS will own data collected via this survey and will not share the collection of Lissel survey.)

Leave a Comment