{"id":2200,"date":"2025-07-02T19:18:29","date_gmt":"2025-07-02T19:18:29","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/07\/02\/using-gordon-to-containerize-your-apps-and-work-with-containers\/"},"modified":"2025-07-02T19:18:29","modified_gmt":"2025-07-02T19:18:29","slug":"using-gordon-to-containerize-your-apps-and-work-with-containers","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/07\/02\/using-gordon-to-containerize-your-apps-and-work-with-containers\/","title":{"rendered":"Using Gordon to Containerize Your Apps and Work with Containers"},"content":{"rendered":"<p>These days, almost every tech company is looking for ways to integrate AI into their apps and workflows, and Docker is no exception. They\u2019ve been rolling out some impressive AI capabilities across their products. This is my first post as a Docker Captain and in this post, I want to shine a spotlight on a feature that hasn\u2019t gotten nearly enough attention in my opinion: <strong>Docker\u2019s AI Agent Gordon<\/strong> (also known as Docker AI), which is built into Docker Desktop and CLI.<\/p>\n<p>Gordon is really helpful when it comes to containerizing applications. Not only does it help you understand how to package your app as a container, but it also reduces the overhead of figuring out dependencies, runtime configs, and other pieces that add to a developer\u2019s daily cognitive load. The best part? Gordon doesn\u2019t just guide you with responses; it can also generate or update<strong> <\/strong>the necessary files for you.<\/p>\n<h2 class=\"wp-block-heading\">The Problem: Containerizing apps and optimizing containers isn\u2019t always easy<\/h2>\n<p>Containerizing apps can range from super simple to a bit tricky, depending on what you\u2019re working with. If your app has a <strong>single runtime<\/strong> like Node.js, Python, or .NET Core, with <strong>clearly defined dependencies<\/strong> and <strong>no external services<\/strong>, it will be straightforward.<\/p>\n<p>A basic Dockerfile will usually get you up and running without much effort. But once you start adding more complexity, like a <strong>backend, frontend, database, and caching layer<\/strong>, you now have the need for a multi-container app. At this point, you might be dealing with additional Dockerfile configurations and potentially a Docker Compose setup. That\u2019s where things can start to be challenging to get going.<\/p>\n<p>This is where Gordon shines. It\u2019s helpful in containerizing apps and can even handle multi-service container app setups, guiding you through what\u2019s needed and even generating the supporting config files, such as Dockerfiles and docker-compose, to get you going.<\/p>\n<h3 class=\"wp-block-heading\">Optimizing containers can be a headache too<\/h3>\n<p>Beyond just containerizing, there\u2019s also the need to <strong>optimize your containers<\/strong> for performance, security, and image size. And let\u2019s face it, optimizing can be tedious. You need to know what base images to use, how to slim them down, how to avoid unnecessary layers, and more.<\/p>\n<p>Gordon can help here too. It provides optimization suggestions, shows you how to apply best practices like multi-stage builds or removing dev dependencies, and helps you create leaner, more secure images.<\/p>\n<h3 class=\"wp-block-heading\">Why not just use general-purpose Generative AI?<\/h3>\n<p>Sure, general-purpose AI tools like ChatGPT, Claude, Gemini, etc. are great and I use them regularly. But when it comes to containers, they can <strong>lack the context<\/strong> needed for accurate and efficient help. Gordon, on the other hand, is <strong>purpose-built for Docker<\/strong>. It has access to Docker\u2019s ecosystem and has been trained on Docker documentation, best practices, and the nuances of Docker tooling. That means its recommendations are more likely to be precise and aligned with the latest standards.<\/p>\n<h2 class=\"wp-block-heading\"><strong>Walkthrough of Gordon<\/strong><\/h2>\n<p>Gordon can help with containerizing applications, optimizing your containers and more. Gordon is still a Beta feature. To start using Gordon, you need Docker Desktop version 4.38 or later. Gordon is powered by Large Language Models (LLMs), and it goes beyond prompt and response: it can perform certain tasks for you as an AI agent. Gordon can have access to your local files and local images when you give it permission. It will prompt you for access if needed for a task.<\/p>\n<p>Please note, the examples I will show in this post are based on a single working session. Now, let\u2019s dive in and start to explore Gordon.<\/p>\n<h3 class=\"wp-block-heading\">Enabling Gordon \/ Docker AI<\/h3>\n<p>In order to turn Gordon on, go to Settings &gt; Beta features check the Enable Docker AI box as shown in the following screenshot.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 1: screenshot of where to enable Docker AI in beta features<\/em><\/p>\n<p>Accept the terms. The AI in Docker Desktop is in two forms. The first one is through the Docker Desktop UI and is known as Gordon. The second option is Docker AI. Docker AI is accessed through the Docker CLI. The way you activate it is by typing Docker AI in the CLI. I will demonstrate this later on in this blog post.\u00a0\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 2: screenshot of Docker AI terms acceptance dialog box<\/em><\/p>\n<h3 class=\"wp-block-heading\">Exploring Gordon in Docker Desktop<\/h3>\n<p>Now Gordon will appear in your Docker Desktop UI. Here you can prompt it just like any Generative AI tool. Gordon will also have examples that you can use to get started working with it.<\/p>\n<p>You can access Gordon throughout Docker Desktop by clicking on the AI icon as shown in the following screenshot.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 3: screenshot of Docker Desktop interface showing the AI icon for Gordon<\/em><\/p>\n<p>When you click on the AI icon a Gordon prompt box appears along with suggested prompts as shown in the following screenshot. The suggestions will change based on the object the AI is next to, and are context-aware.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 4: Screenshot showing Gordon\u2019s suggestion prompt box in Docker Desktop UI<\/em><\/p>\n<p>Here is another example of Docker AI suggestions being context-aware based on what area of Docker Desktop you are in.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>\u00a0Figure 5: Screenshot showing Docker AI context- specific suggestions<\/em>\u00a0<\/p>\n<p>Another common use case for Gordon is listing local images and using AI to work with them. You can see this in the following set of screenshots. Notice that Gordon will prompt you for permission before showing your local images.<\/p>\n\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 6: Screenshot showing Gordon referencing local images<\/em>\u00a0<\/p>\n<p>You can also prompt Gordon to take action. As shown in the following screenshot, I asked Gordon to run one of my images.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 7: Screenshot showing Gordon prompts<\/em>\u00a0<\/p>\n<p>If it can\u2019t perform the action, it will attempt to help you.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 8: Screenshot showing Gordon prompt response to failed request<\/em>\u00a0<\/p>\n<p>Another cool use of Gordon is to explain a container image to you. When you ask this, Gordon will ask you to select the directory where the Dockerfile is and permission to access it as shown in the following screenshot.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 9: Screenshot showing Gordon\u2019s request for particular directory access<\/em>\u00a0<\/p>\n<p>After you give it access to the directory where the Dockerfile is, it will then breakdown what\u2019s in the Dockerfile.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 10: Screenshot showing Gordon\u2019s response to explaining a Dockerfile<\/em>\u00a0<\/p>\n<p>As shown in the following screenshot, I followed up with a prompt asking Gordon to display what\u2019s in the Dockerfile. It did a good job of explaining its contents, as shown in the following screenshot.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 11: Screenshot showing Gordon\u2019s response regarding Dockerfile contents<\/em><\/p>\n<h3 class=\"wp-block-heading\">Exploring Gordon in the Docker Desktop CLI<\/h3>\n<p>Let\u2019s take a quick tour through Gordon in the CLI. Gordon is referred to as Docker AI in the CLI. To work with Docker AI, you need to launch the Docker CLI as shown in the following screenshot.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 12: Screenshot showing how to launch Docker AI from the CLI<\/em>\u00a0<\/p>\n<p>Once in the CLI you can type \u201cdocker ai\u201d and it will bring you into the chat experience so you can prompt Gordon. In my example, I asked Gordon about one of my local images. You can see that it asked me for permission.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 13: Screenshot showing Docker CLI request for access<\/em><\/p>\n<p>Next, I asked Docker AI to list all of my local images as shown in the following screenshot.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 14: Screenshot showing Docker CLI response to display local images<\/em>\u00a0<\/p>\n<p>I then tested pulling an image using Docker AI. As you can see in the following screenshot, Gordon pulled a nodeJS image for me!<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 15: Screenshot showing Docker CLI pulling nodeJS image<\/em><\/p>\n\n<h3 class=\"wp-block-heading\">Containerizing an application with Gordon<\/h3>\n<p>Now let\u2019s explore the experience of containerizing an application using Gordon.<\/p>\n<p>I started by clicking on the example for containerizing an application. Gordon then prompted me for the directory where my application code is.\u00a0<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 16: Screenshot showing where to enable access to directory for containerizing an application<\/em>\u00a0<\/p>\n<p>I pointed it to my apps directory and gave it permission. It then started to analyze and containerize my app. It picked up the language and started to read through my app\u2019s README file.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 17: Screenshot showing Gordon starting to analyze and containerize app<\/em>\u00a0<\/p>\n<p>You can see it understand the app was written in JavaScript and worked through the packages and dependencies.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 18: Screenshot showing final steps of Gordon processing<\/em><\/p>\n<p>Gordon understands that my app has a backend, frontend, and a database, knowing from this that I would need a Docker compose file.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 19: Screenshot showing successful completion of steps to complete the Dockerfiles<\/em><\/p>\n<p>From the following screenshot you can see the Docker related files needed for my app. Gordon created all of these.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 20: Screenshot showing files produced from Gordon<\/em>\u00a0<\/p>\n<p>Gordon created the Dockerfile (on the left) and a Compose yaml file (on the right) even picking up that I needed a Postgres DB for this application.<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 21: Screenshot showing Dockerfile and Compose yaml file produced from Gordon<\/em><\/p>\n<p>I then took it a step further and asked Gordon to build and run the container for my application using the prompt \u201cCan you build and run this application with compose?\u201d It created the Docker Compose file, built the images, and ran the containers!<\/p>\n<div class=\"wp-block-ponyo-image\">\n<\/div>\n<p><em>Figure 22: Screenshot showing completed containers from Gordon<\/em><\/p>\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n<p>I hope you picked up some useful insights about Docker and discovered one of its lesser-known AI features in Docker Desktop. We explored what Gordon is, how it compares to general-purpose generative AI tools like ChatGPT, Claude, and Gemini, and walked through use cases such as containerizing an application and working with local images. We also touched on how Gordon can support developers and IT professionals who work with containers. If you haven\u2019t already, I encourage you to enable Gordon and take it for a test run. Thanks for reading and stay tuned for more blog posts coming soon.<\/p>","protected":false},"excerpt":{"rendered":"<p>These days, almost every tech company is looking for ways to integrate AI into their apps and workflows, and Docker [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2200","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=2200"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2200\/revisions"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=2200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=2200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=2200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}