From c3826fd4c9c789e8772ed750bed00111ccc25d2f Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:19:27 +0200 Subject: [PATCH] guides: add overview for the building images guide Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- .../docker-concepts/building-images/_index.md | 32 +++++++++++++++++++ .../build-tag-and-publish-an-image.md | 5 +++ .../building-images/multi-stage-builds.md | 7 +++- .../understanding-image-layers.md | 5 +++ .../building-images/using-the-build-cache.md | 7 ++++ .../building-images/writing-a-dockerfile.md | 6 ++++ data/toc.yaml | 2 ++ 7 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 content/guides/docker-concepts/building-images/_index.md diff --git a/content/guides/docker-concepts/building-images/_index.md b/content/guides/docker-concepts/building-images/_index.md new file mode 100644 index 0000000000..fb760143f5 --- /dev/null +++ b/content/guides/docker-concepts/building-images/_index.md @@ -0,0 +1,32 @@ +--- +title: Building images +keywords: build images, Dockerfile, layers, tag, push, cache, multi-stage +description: | + Learn how to build Docker images from a Dockerfile. You'll understand the + structure of a Dockerfile, how to build an image, and how to customize the + build process. +summary: | + Building container images is both technical and an art. You want to keep the + image small and focused to increase your security posture, but also need to + balance potential tradeoffs, such as caching impacts. In this series, you’ll + deep dive into the secrets of images, how they are built and best practices. +layout: series +params: + skill: Beginner + time: 25 minutes + prereq: None +--- + +## About this series + +Learn how to build production-ready images that are lean and efficient Docker +images, essential for minimizing overhead and enhancing deployment in +production environments. + +## What you'll learn + +- Understanding image layers +- Writing a Dockerfile +- Build, tag and publish an image +- Using the build cache +- Multi-stage builds diff --git a/content/guides/docker-concepts/building-images/build-tag-and-publish-an-image.md b/content/guides/docker-concepts/building-images/build-tag-and-publish-an-image.md index 8e530594fc..7ba76e71cf 100644 --- a/content/guides/docker-concepts/building-images/build-tag-and-publish-an-image.md +++ b/content/guides/docker-concepts/building-images/build-tag-and-publish-an-image.md @@ -2,6 +2,11 @@ title: Build, tag, and publish an image keywords: concepts, build, images, container, docker desktop description: This concept page will teach you how to build, tag, and publish an image to Docker Hub or any other registry +summary: | + Building, tagging, and publishing Docker images are key steps in the + containerization workflow. In this guide, you’ll learn how to create Docker + images, how to tag those images with a unique identifier, and how to publish + your image to a public registry. --- {{< youtube-embed chiiGLlYRlY >}} diff --git a/content/guides/docker-concepts/building-images/multi-stage-builds.md b/content/guides/docker-concepts/building-images/multi-stage-builds.md index 65f3d49543..e4172a4427 100644 --- a/content/guides/docker-concepts/building-images/multi-stage-builds.md +++ b/content/guides/docker-concepts/building-images/multi-stage-builds.md @@ -2,6 +2,12 @@ title: Multi-stage builds keywords: concepts, build, images, container, docker desktop description: This concept page will teach you about the purpose of the multi-stage build and its benefits +summary: | + By separating the build environment from the final runtime environment, you + can significantly reduce the image size and attack surface. In this guide, + you'll unlock the power of multi-stage builds to create lean and efficient + Docker images, essential for minimizing overhead and enhancing deployment in + production environments. --- {{< youtube-embed vR185cjwxZ8 >}} @@ -327,4 +333,3 @@ Now that you have the project, you’re ready to create the `Dockerfile`. * [Base images](/build/building/base-images/) * [Spring Boot Docker](https://spring.io/guides/topicals/spring-boot-docker) - diff --git a/content/guides/docker-concepts/building-images/understanding-image-layers.md b/content/guides/docker-concepts/building-images/understanding-image-layers.md index de822b1e5e..a255b4bbd1 100644 --- a/content/guides/docker-concepts/building-images/understanding-image-layers.md +++ b/content/guides/docker-concepts/building-images/understanding-image-layers.md @@ -2,6 +2,11 @@ title: Understanding the image layers keywords: concepts, build, images, container, docker desktop description: This concept page will teach you about the layers of container image. +summary: | + Have you ever wondered how images work? This guide will help you to + understand image layers - the fundamental building blocks of container + images. You'll gain a comprehensive understanding of how layers are created, + stacked, and utilized to ensure efficient and optimized containers. --- {{< youtube-embed wJwqtAkmtQA >}} diff --git a/content/guides/docker-concepts/building-images/using-the-build-cache.md b/content/guides/docker-concepts/building-images/using-the-build-cache.md index 57f9d26958..d36b6f5997 100644 --- a/content/guides/docker-concepts/building-images/using-the-build-cache.md +++ b/content/guides/docker-concepts/building-images/using-the-build-cache.md @@ -2,6 +2,13 @@ title: Using the build cache keywords: concepts, build, images, container, docker desktop description: This concept page will teach you about the build cache, what changes invalidate the cache and how to effectively use the build cache. +summary: | + Using the build cache effectively allows you to achieve faster builds by + reusing results from previous builds and skipping unnecessary steps. To + maximize cache usage and avoid resource-intensive and time-consuming + rebuilds, it's crucial to understand how cache invalidation works. In this + guide, you’ll learn how to use the Docker build cache efficiently for + streamlined Docker image development and continuous integration workflows. --- {{< youtube-embed Ri6jMknjprY >}} diff --git a/content/guides/docker-concepts/building-images/writing-a-dockerfile.md b/content/guides/docker-concepts/building-images/writing-a-dockerfile.md index b914951225..6cef69e5cb 100644 --- a/content/guides/docker-concepts/building-images/writing-a-dockerfile.md +++ b/content/guides/docker-concepts/building-images/writing-a-dockerfile.md @@ -2,6 +2,12 @@ title: Writing a Dockerfile keywords: concepts, build, images, container, docker desktop description: This concept page will teach you how to create image using Dockerfile. +summary: | + Mastering Dockerfile practices is vital for leveraging container technology + effectively, enhancing application reliability and supporting DevOps and + CI/CD methodologies. In this guide, you’ll learn how to write a Dockerfile, + how to define a base image and setup instructions, including software + installation and copying necessary files. --- {{< youtube-embed Jx8zoIhiP4c >}} diff --git a/data/toc.yaml b/data/toc.yaml index f60bd5c6aa..7098f42aa6 100644 --- a/data/toc.yaml +++ b/data/toc.yaml @@ -31,6 +31,8 @@ Guides: path: /guides/docker-concepts/the-basics/what-is-docker-compose/ - sectiontitle: "Building images" section: + - title: Overview + path: /guides/docker-concepts/building-images/ - title: "Understanding image layers" path: /guides/docker-concepts/building-images/understanding-image-layers/ - title: "Writing a Dockerfile"