mirror of
https://github.com/docker/docs.git
synced 2026-03-31 16:28:59 +07:00
* Reword lots of instances of 'will' * Reword lots of instances of won't * Reword lots of instances of we'll * Eradicate you'll * Eradicate 'be able to' type of phrases * Eradicate 'unable to' type of phrases * Eradicate 'has / have to' type of phrases * Eradicate 'note that' type of phrases * Eradicate 'in order to' type of phrases * Redirect to official Chef and Puppet docs * Eradicate gratuitous 'please' * Reduce use of e.g. * Reduce use of i.e. * Reduce use of N.B. * Get rid of 'sexagesimal' and correct some errors
84 lines
2.2 KiB
Markdown
84 lines
2.2 KiB
Markdown
---
|
||
description: Autoredeploy
|
||
keywords: Autoredeploy, image, store, service
|
||
redirect_from:
|
||
- /docker-cloud/feature-reference/auto-redeploy/
|
||
title: Redeploy services automatically
|
||
---
|
||
|
||
[](https://www.youtube.com/watch?v=I4depUwfbFc "Automated Deployments with Docker Cloud"){:target="_blank"}
|
||
|
||
Docker Cloud's **Autoredeploy** feature allows a service that uses an image
|
||
stored in Docker Hub to automatically redeploy whenever a new image is pushed or
|
||
built.
|
||
|
||
> **Notes**:
|
||
>
|
||
>* **Autoredeploy** works only for hub images with the _latest_ tag.
|
||
>
|
||
>* To enable **autoredeploy** on an image stored in a third party registry,
|
||
> you need to use [redeploy triggers](triggers.md) instead.
|
||
|
||
## Launch a new service with autoredeploy
|
||
|
||
You can launch a service with **autoredeploy** enabled by enabling it from the **general settings** section of the **Launch new service** wizard.
|
||
|
||

|
||
|
||
By default, autoredeploy is *deactivated*.
|
||
|
||
### Use the CLI or API
|
||
|
||
You can enable **autoredeploy** when launching a service using the CLI or API.
|
||
|
||
By default, autoredeploy is set to `false`. See the [API documentation](/apidocs/docker-cloud.md) for more information.
|
||
|
||
#### Enable autoredeploy using the CLI
|
||
|
||
```
|
||
$ docker-cloud service run --autoredeploy [...]
|
||
```
|
||
|
||
#### Enable autoredeploy using the API
|
||
|
||
```
|
||
POST /api/app/v1/service/ HTTP/1.1
|
||
{
|
||
"autoredeploy": true,
|
||
[...]
|
||
}
|
||
```
|
||
|
||
## Enable autoredeploy to an already deployed service
|
||
|
||
You can activate or deactivate **autoredeploy** on a service after it has been deployed.
|
||
|
||
1. Click into the service detail page.
|
||
2. Click **Edit**.
|
||
3. Change the **autoredeploy** setting on the form to `true`.
|
||
4. Click **Save changes**.
|
||
|
||
|
||
### Use the CLI or API
|
||
|
||
You can set the **autoredeploy** option after the service has been deployed,
|
||
using the CLI or API.
|
||
|
||
Check our [API documentation](/apidocs/docker-cloud.md) for more information.
|
||
|
||
|
||
#### Enable autoredeploy using the CLI
|
||
|
||
```bash
|
||
$ docker-cloud service set --autoredeploy (name or uuid)
|
||
```
|
||
|
||
### Enable autoredeploy using the API
|
||
|
||
```
|
||
PATCH /api/app/v1/service/(uuid)/ HTTP/1.1
|
||
{
|
||
"autoredeploy": true
|
||
}
|
||
```
|