🚀 Continuous Deployment of Containers
Many Docker applications are frequently updated with new versions and fixes. To keep your environments up to date on the SaveinCloud platform, it is recommended to perform the redeploy of containers whenever new tags are released.
The redeploy allows updating a container's image without affecting the application's persistent data.
🔁 How Redeploy Works
- A new container is created internally from the new image (tag).
- The current container's custom data is mapped and preserved.
- The original container is stopped and updated with the new files.
- A snapshot is created before the operation to allow rollback in case of failure.
💡 If you use multiple instances (horizontal scalability), it is possible to update each container sequentially, reducing or even avoiding downtime.
It is extremely important to perform all tests in a staging environment before including this type of process in a production environment, since misconfiguration of the data to be preserved can lead to data loss. To learn more about how to preserve data, Read Here
🖥️ Redeploy via SaveinCloud Panel
- Access the environment and click Redeploy Container(s) on the desired container or layer.
- Choose the new image Tag.
- Configure additional options:
- Keep volumes data: keeps persistent data (recommended).
- Sequential deployment with delay: gradual redeploy, one by one, with delay.
- Temporarily remove node(s) from DNS: temporarily removes from DNS during redeploy.
- Click Redeploy and confirm the operation.
🔗 Redeploy via API
Use the endpoint:
POST /1.0/environment/control/rest/redeploycontainers
Parameters:
envName: environment name.session: access token.nodeGroup: layer (optional).nodeId: container ID (optional).tag: new image version.useExistingVolumes:trueto preserve volumes.login/password: if image is private.manageDNSState:trueto adjust DNS during sequential update.
✅ Use
RedeployContainersByGroupif you need to customize delays between containers.
Example with curl:
curl --location 'https://{{platformDomain}}/1.0/environment/control/rest/redeploycontainers' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'envName=meu-ambiente' \
--data-urlencode 'session={{session}}' \
--data-urlencode 'nodeGroup=cp' \
--data-urlencode 'tag=1.2.3' \
--data-urlencode 'useExistingVolumes=true'
🧰 Redeploy via CLI
- List environments and containers:
~/saveincloud/environment/control/getenvs
~/saveincloud/environment/control/getenvinfo --envName meu-ambiente
- List available tags for a container:
~/saveincloud/environment/control/getcontainernodetags --envName meu-ambiente --nodeId 12345
- Perform the redeploy:
~/saveincloud/environment/control/redeploycontainers \
--envName meu-ambiente \
--nodeId 12345 \
--tag 1.2.3 \
--useExistingVolumes true
🔐 Include
--loginand--passwordif you are using a private image.
✅ Conclusion
With the redeploy process on the SaveinCloud platform, you can keep your Docker applications updated safely and flexibly, whether via panel, API, or CLI — maintaining persistent data and the lowest possible downtime.