Updating the Docker Image Cache

This API call will start a new deployment to force a Docker Image Cache (DIC) update. Squash will update the DIC cache during the shutdown process of the deployment.

This is useful for relatively large applications using dynamic data in Dockerfiles, such as database dumps and other assets that need to be updated on a regular basis.

Deployments using DIC usually have a faster startup time since Squash automatically skips the Docker build process. However, updating the DIC cache is usually slower depending on the project since Squash will run the Docker build process from scratch. This API call can help to automate this process so you can keep your deployments running fast while updating the DIC cache as often as needed.

API Specs

https://api.squash.io/a/dis/start/?deployment_id=<deployment_id>&expire=<expire_time>
HTTP Method: GET
Success Response Code: 200
Success Response Body: JSON data

expire: this argument controls how long the deployments should stay active. After the expire time is reached Squash will automatically shut down the deployment. Available options for this field: 30m,1h,2h,3h,4h,5h,6h

deployment_id: this is a unique identifier generate by Squash for a given branch. This is available on any regular Squash deployment URLs, you can get this from a GitHub Pull Request comment generated by Squash or by going to the New deployment page.

This is how the unique identifier looks like, this is the alphanumeric part right after the branch name and before the squash domain:

../_images/new-deploy-page.png

Sample Request

$ curl -i -H 'Squash-Key: B6mtwX0htEW0HaFp9X25UtJsiX1uBNHNsxAptnum2VxgXVwmrJfmd74En1a8MwFe' \
 https://api.squash.io/a/dis/start/?deployment_id=w3sa2&expire=1h

Response Sample

{"status": "ready",
 "ssh_port": "6512",
 "ssh_ip": "18.118.25.254",
 "deployment_url": "https://cart-v2-i3fg1.squash.io",
 "execution_id": "0f0d8890-ad2f-4c38-8457-b166c36bffe3",
 "msg": "deployment is starting up"
}
  • status has the following options: “pending”, “ready” and “error”
    • pending: the deployment has started successfully and is in progress
    • ready: the deployment start up process is ready and you can now connect to the server through SSH.
    • error: an error message and error code are included within the msg field
  • ssh_port: only available when status is ready
  • ssh_ip: only available when status is ready
  • deployment_url: This is the Squash URL of this deployment that you can use for testing
  • execution_id: This is a long unique identifier that represents an specific deployment run
  • msg: Squash will display status or error messages in this field