{"id":1846,"date":"2025-07-16T15:27:03","date_gmt":"2025-07-16T12:27:03","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/docker-offload-cloud-develop-local\/"},"modified":"2025-07-16T15:27:03","modified_gmt":"2025-07-16T12:27:03","slug":"docker-offload-cloud-develop-local","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/docker-offload-cloud-develop-local\/","title":{"rendered":"Docker Offload \u2013 Using the power of the cloud to develop locally"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">As Docker Captain, I have the privilege of testing the solutions before the public availability of the service or feature. This time, Docker prepared a few huge changes to the product, which made the whole development lifecycle much easier.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">The WeAreDeveloper announcement<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">During the keynote of WeAreDevelopers conference, Docker announced three features to the Docker Desktop, two related to AI, and one related to overall way of work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we dig into the general improvement of our work, Docker Offload.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Why is it important to you?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Docker Offload offers functionalities that connect local development with cloud resources. For individuals and companies, the cost of modern GPU chips, cards, and computers (in general, modern GPU-powered compute power) is still expensive. Docker allows users to \u201cdelegate\u201d their local work to the cloud, where powerful GPU chips are hosted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em><mark class=\"has-inline-color has-vivid-purple-color\">At UpCloud we allow you to use very modern and powerful GPU powered units with Nvidia L40S. Unformtunatelly, Docker Offload works in Docker Cloud only, but you can run your GPU heavy tasks using docker Compose at UpCloud anyway!<\/mark><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The huge improvement for daily work is that you can more flexibly use GPUs, in on-demand and pay-as-you-go schema.&nbsp;<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">What is Docker Offload?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Docker Offload allows you to move your local workloads to the Docker Cloud. What is most important here is that you don\u2019t \u201cfeel\u201d any difference in the way you work. The same CLI commands, the same system\u2019s behaviour, the same operations. The only difference is that you use Cloud-base resources, which are much more powerful than in your laptop.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Enable Docker Offload<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Docker Offload is part of Docker Desktop. It can be enabled from the GUI or the CLI. First, ensure you have the most recent Docker Desktop installed. If so, run the command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker offload start<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see this screen<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/1.webp\" alt=\"-\" class=\"wp-image-58466\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">On this screen, you have to select the account you want to use. In other words, you create (or select) another workspace, and after offload is enabled, you work solely there.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next step is to answer the GPU question.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/2.webp\" alt=\"-\" class=\"wp-image-58467\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After confirming your selection, you are ready to go!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/3.webp\" alt=\"-\" class=\"wp-image-58470\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The new context is ready to be used.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">The work experience<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">From the perspective of someone using Docker in CLI or Docker Desktop, nothing will change. The only difference is that everything you do, you do in the cloud. Pulling images, building, running containers, running Compose, managing containers \u2013 everything happens in the cloud, and nothing will be stored on your machine locally. Of course, your code, Dockerfiles, Compose files, etc., are still local, everything related to running your workloads goes to the cloud.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Current pricing model<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Docker also announced the pricing of this service. Today, we can use Docker Offload for free for 300 minutes. After that time, the price depends on the use of GPUs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>$0.015 per minute if using a GPU<\/li>\n\n\n\n<li>$0.01 per minute if a GPU is not used<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Let\u2019s run a simple test!<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we know what Docker Offload is, how much it costs, and why you should take a look at it. It is time to see how it can be used.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The goal<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The goal of this experiment is to see if we really use cloud-based infrastructure. For this, we will check the GPU installed in the hardware we use. We will compare the local run with the offloaded run.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check local hardware<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First, let\u2019s check the status of the Offload service, using<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker offload status<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is what you should see<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/4.webp\" alt=\"-\" class=\"wp-image-58472\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Docker Offload is stopped, which means we use our local hardware. To check what GPU you have installed, run this container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker run --rm --gpus all nvidia\/cuda:12.4.0-runtime-ubuntu22.04 nvidia-smi<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This runs a nvidia\/cuda image, with the \u201c<strong>nvidia-smi<\/strong>\u201d command, which will provide information about the GPU chip. Also worth noting is the use of the \u201c<strong>&#8211;gpus all<\/strong>\u201d parameter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you run the container for the first time, the huge image must be pulled. It will take a moment, as the image is 2.3GB. When it is finally run, you will see something similar to my output<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/5.webp\" alt=\"-\" class=\"wp-image-58475\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In my case, the GPU is Nvidia GeForce GTX 1660 Ti. Yours will be different (if any).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Run the check in the cloud<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It is time to enable Offload again and check the status.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker offload start<\/code><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker offload status<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/6.webp\" alt=\"-\" class=\"wp-image-58478\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As everything works, we can run the same container again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker run --rm --gpus all nvidia\/cuda:12.4.0-runtime-ubuntu22.04 nvidia-smi<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">First of all, you\u2019ll see that the image is pulled. However, this time it is pulled in the cloud, in your cloud\u2019s context. And you probably noticed that the pull was quicker than in your local laptop (if not, I am jealous!).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What is the result?<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/7-1024x640.webp\" alt=\"-\" class=\"wp-image-58480\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This time, the GPU chip is Nvidia L4. This confirms that we used the cloud infrastructure.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">What can you do with Docker Offload?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You can do everything you have done so far locally, but with more resources, power, and better performance. You can run Docker Compose in the same way you did before, just by using the docker compose up command.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As I said, the feel of use is exactly the same as for your local containers; I didn\u2019t exaggerate. When you expose a port, like 3000, for your web app, you put in your browser <strong>localhost:3000,<\/strong> and you can check this app, just as you do now. Yes, you still put localhost in your browser, even if the workload exists in the cloud.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">How to check what context I use?<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">There are a couple of ways to know that. First, you can run the command I already provided &#8211;&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker offload status<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Another command is<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>docker context ls<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which will print the following information<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/8.webp\" alt=\"-\" class=\"wp-image-58481\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can see the asterisk next to the currently selected context.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Docker Desktop, there are indicators that provide this information. Like, for example, the top bar change:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/10.webp\" alt=\"-\" class=\"wp-image-58483\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The picture above shows how the bar looks when you operate locally, and the picture below shows how it looks when you are using the cloud.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/upcloud.com\/media\/11.webp\" alt=\"-\" class=\"wp-image-58484\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Summary<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we introduced Docker Offload, a significant new feature for Docker Desktop that enables developers to run their Docker workloads in the cloud rather than solely on local machines. This is particularly advantageous for workloads demanding substantial GPU resources.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Developers can continue to use familiar CLI commands and experience the same operational feel, with the key difference being that all actions are executed in the cloud.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Key Takeaways<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cost-Effective GPU Access<\/strong>: Docker Offload provides an affordable, on-demand solution for accessing high-performance GPU compute power, eliminating the need for expensive local hardware investments.<\/li>\n\n\n\n<li><strong>Seamless Cloud Integration<\/strong>: Developers can leverage powerful cloud resources without altering their current Docker workflows or command-line habits, ensuring a smooth transition.<\/li>\n\n\n\n<li><strong>Enhanced Performance<\/strong>: Offloading resource-intensive operations to the cloud can significantly accelerate image pulls, builds, and container execution.<\/li>\n\n\n\n<li><strong>Flexible Resource Utilization<\/strong>: The pay-as-you-go model allows for efficient and flexible use of cloud GPUs only when they are specifically required.<\/li>\n\n\n\n<li><strong>Continued `localhost` Accessibility<\/strong>: Even when workloads are executed in the cloud, exposed container ports remain accessible via `localhost` in your web browser, maintaining a familiar development experience and making the development process just as easy but more powerful for developers.<\/li>\n<\/ul>\n","protected":false},"author":100,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","community-category":[241,223],"class_list":["post-1846","tutorial","type-tutorial","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=1846"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1846\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=1846"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=1846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}