Skip to main content

🚀 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

  1. A new container is created internally from the new image (tag).
  2. The current container's custom data is mapped and preserved.
  3. The original container is stopped and updated with the new files.
  4. 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.

danger

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

  1. Access the environment and click Redeploy Container(s) on the desired container or layer.
  2. Choose the new image Tag.
  3. 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.
  4. 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: true to preserve volumes.
  • login/password: if image is private.
  • manageDNSState: true to adjust DNS during sequential update.

✅ Use RedeployContainersByGroup if 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

  1. List environments and containers:
~/saveincloud/environment/control/getenvs
~/saveincloud/environment/control/getenvinfo --envName meu-ambiente
  1. List available tags for a container:
~/saveincloud/environment/control/getcontainernodetags --envName meu-ambiente --nodeId 12345
  1. Perform the redeploy:
~/saveincloud/environment/control/redeploycontainers \
--envName meu-ambiente \
--nodeId 12345 \
--tag 1.2.3 \
--useExistingVolumes true

🔐 Include --login and --password if 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.