9.0 KiB
title | description | keywords | sitemap |
---|---|---|---|
Docker Run Cloud | Learn how you can run your applications in the cloud with Docker Run Cloud | run, cloud, docker desktop, resources | false |
{{% restricted title="Private preview" %}} Docker Run Cloud is in Private preview. {{% /restricted %}}
Docker Run Cloud brings the power of the cloud to your local development workflow. You can now run your applications in the cloud whilst continuing to use your existing tools and workflows and without worrying about local resource limitations. Docker Run Cloud also lets you share previews of your cloud-based applications for real-time feedback.
Set up
To get started with Docker Run Cloud, you need to:
- Have a Docker account that's part of a Docker organization
- Email
run.cloud@docker.com
to get help with onboarding
Quickstart
You can use Docker Run Cloud from the Docker Dashboard or from the CLI.
This guide introduces you to essential commands and steps for creating, managing, and sharing a cloud engine.
Step one: Create a cloud engine
{{< tabs group="method" >}} {{< tab name="Docker Desktop">}}
-
In the Docker Dashboard, navigate to the Docker Run Cloud tab.
-
In the top right-hand corner, select Create Cloud Engine.
-
Fill out the creation form:
- Enter
cloudengine
as the name - Choose an organization to associate the cloud engine with
- Select the engine size and architecture
Note that the Switch Docker Context to use remote engine is selected by default. The automatically switches you to your new cloud engine once it has been created.
- Enter
-
Select Create.
To verify creation, check the context switcher in the top-left corner of the Docker Dashboard; it should display cloudengine
. You’re now ready to use it.
{{< /tab >}} {{< tab name="CLI">}}
Run the following command:
$ docker harmonia engine create cloudengine --arch "amd64" --use
This creates an engine called cloudengine
and:
- Immediately switches you to the new cloud engine with the
--use
flag. - Sets the engine's CPU architecture to amd64 using the
--arch "amd64"
flag. You can choose between amd64 and arm64. - Configures the engine size with the
--size "standard"
flag. Options are standard (2 CPU cores, 4GB RAM, default) or large (4 CPU cores, 8GB RAM).
To verify you're using the newly created cloud engine, run:
$ docker context inspect
You should see the following:
[
{
"Name": "cloudengine2",
...
{{< /tab >}} {{< /tabs >}}
Step two: Run and remove containers with the newly created cloud engine
- Run an Nginx container in the cloud engine:
This maps the container's port$ docker run -d -p 8080:80 nginx
80
to the host's port8080
. If port8080
is already in use on your host, you can specify a different port. - View the Nginx welcome page. Navigate to
http://localhost/
. - Verify the running container:
- In the Containers tab in the Docker Dashboard, you should see your Nginx container listed.
- Alternatively, list all running containers in the cloud engine via the terminal:
$ docker ps
Running a container with a cloud engine is just as straightforward as running it locally.
Step three: Create and switch to a new cloud engine
{{< tabs group="method" >}} {{< tab name="Docker Desktop">}}
- Create a new cloud engine:
- Enter
cloudengine2
as the name - Choose an organization to associate the cloud engine with
- Select the Standard engine size with the AMD-64 architecture
In the Docker Run Cloud view you should now see both
cloudengine
andcloudengine2
.
- Enter
- Switch between engines, also known as your Docker contexts. Use the context switcher in the top-left corner of the Docker Dashboard to toggle between your cloud engines or switch from your local engine (
desktop-linux
) to a cloud engine.
{{< /tab >}} {{< tab name="CLI">}}
- Create a new cloud engine. Run:
Docker automatically switches you to your new cloud engine.$ docker harmonia engine create cloudengine2
- Switch between engines, also known as your Docker contexts. Either switch to your first cloud engine:
$ docker context use cloudengine ``` Or switch back to your local engine: ```console $ docker context use desktop-linux
{{< /tab >}} {{< /tabs >}}
Step four: Use a file sync for your cloud engine
Docker Run Cloud takes advantage of Synchronized file shares to enable local-to-remote file shares and port mappings.
{{< tabs group="method" >}} {{< tab name="Docker Desktop">}}
- Clone the Awesome Compose repository.
- In the Docker Dashboard, navigate to the Docker Run Cloud view.
- For the
cloudengine
cloud engine, select the Actions menu and then Manage file syncs. - Select Create file sync.
- Navigate to the
awesome-compose/react-express-mysql
folder and select Open. - In your terminal, navigate to the
awesome-compose/react-express-mysql
directory. - Run the project in the cloud engine with:
$ docker compose up -d
- Test the application by visiting
http://localhost:3000
.
You should see the home page. The code for this page is located inreact-express-mysql/frontend/src/App.js
. - In an IDE or text editor, open the
App.js
file, change some text, and save. Watch as the code reloads live in your browser.
{{< /tab >}} {{< tab name="CLI">}}
- Clone the Awesome Compose repository.
- In your terminal, change into the
awesome-compose/react-express-mysql
directory. - Create a file sync for
cloudengine
:$ docker harmonia file-sync create --engine cloudengine $PWD
- Run the project in the cloud engine with:
$ docker compose up -d
- Test the application by visiting
http://localhost:3000
.
You should see the home page. The code for this page is located inreact-express-mysql/frontend/src/App.js
. - In an IDE or text editor, open the
App.js
file, change some text, and save. Watch as the code reloads live in your browser.
{{< /tab >}} {{< /tabs >}}
Step five: Share a container port
{{< tabs group="method" >}} {{< tab name="Docker Desktop">}}
- Make sure your Docker context is set to
cloudengine
. - In your terminal, run the Nginx container:
$ docker run -d -p 8080:80 nginx
- In the Docker Dashboard, navigate to the Containers view.
- Select the lock icon in the Ports column of your running container. This creates a publicly accessible URL that you can share with teammates.
- Select the copy icon, to copy this URL.
To view all shared ports for your Docker context, select the Shared ports icon in the bottom-right corner of the Docker Dashboard.
{{< /tab >}} {{< tab name="CLI">}}
To share a container port, make sure your Docker context is set to cloudengine
and then run:
$ docker harmonia engine share create cloudengine 3000
This returns a publicly accessible URL for your React app hosted on port 3000
, that you can share with teammates.
To see a list of all your shared ports, run:
$ docker harmonia engine share list
{{< /tab >}} {{< /tabs >}}
Step six: Clean up
{{< tabs group="method" >}} {{< tab name="Docker Desktop">}}
To remove a file sync session:
- Navigate to your cloud engine in the Docker Run Cloud view.
- Select the Actions menu and then Manage file syncs.
- Select the drop-down icon on the file sync.
- Select Delete.
To remove a cloud engine, navigate to the Docker Run Cloud view and then select the delete icon.
{{< /tab >}} {{< tab name="CLI">}}
To remove the file sync session, run:
$ docker harmonia file-sync delete --engine cloudengine $PWD
To remove a cloud engine, run:
$ docker harmonia engine delete <name-of-engine>
{{< /tab >}} {{< /tabs >}}
Troubleshoot
Run docker harmonia doctor
to print helpful troubleshooting information.
Known issues
- KinD does not run on Docker Run Cloud due to some hard-coded assumptions to ensure it's running in a privileged container. K3d is a good alternative.
- Containers cannot access host through DNS
host.docker.internal
. - File binds (non-directory binds) are currently static, meaning changes will not be reflected until the container is restarted. This also affects Compose configs and secrets directives.
- Bind volumes are not supported.
- Port-forwarding support for UDP
- Docker Compose projects relying on
watch
insync
mode are not working with thetar
synchronizer. Configure it to usedocker cp
instead, disable tar sync by settingCOMPOSE_EXPERIMENTAL_WATCH_TAR=0
in your environment. - Some Docker Engine features that let you access the underlying host, such as
--pid=host
,--network=host
, and--ipc=host
, are currently disabled.