I’ve got an environment.json file setup like this:
{
"build": {
"dockerfile": "../.docker/Dockerfile",
"context": ".."
},
"install": "bash .docker/scripts/cloud-agent-install.sh",
"start": "bash .docker/scripts/cloud-agent-start.sh"
}
It seems to be working fine, but I’ve noticed that my cloud agents will randomly build the docker file (which takes like 5-10 mins), after saying they’re starting from a snapshot. And then they’ll say they’re saving a snapshot (which I’d assume would be used going forward), but the next cloud agent will do the same thing!
Why does the agent not accurately show its setup history?
Bit of a side note, but it’s annoying that the history of the cloud agent setup is silently rewritten to remove the docker build steps once they’re done. The same agent that I shared the image of above shows this once up and running:
No mention of docker, and the timestamps there make it seem like this took about a minute, when it was actually about 10x that.
What are snapshots for in the context of using environment.json / docker?
This screen below shows “setup runs”, but I’m guessing that’s different from snapshots (since they have different IDs)? Why don’t we see the list of all snapshots anywhere? Am I supposed to be putting the snapshot ID in the environment.json file (I see the spec references it)? That seems to defeat the purpose of having automatic snapshots…what am I missing here?
In case it’s related, you can see from the screenshot above that my update script section on the cloud agent environment settings is not set, because I’m assuming that I don’t need it since I’m using the install and start sections on the environment.json file, but maybe that’s causing problems with snapshots?
I don’t want to share the contents of the install and start scripts, and I’ll confess that I’m a little unclear on what should go in which one, and how that might affect the snapshot / docker build issues referenced above. But generally in install I’m running composer and npm install commands, plus installing other packages via different methods. I do start mysql so I can run database migrations, because my thinking was that the snapshot probably captures post-install but pre-start?
Anyway, I feel like I must be missing something here, any help would be appreciated!


