Environments are designed to sustain scheduled shutdowns and rebuilds. An environment lifecycle resilient to stops and starts means you can save dollars on cloud compute and justify more powerful dev machines :).
Rebuilding an environment allows you to update to the latest image, edit resource requests, or restart your environment after a shutdown.
/home/<username> directory persists between rebuilds. Rebuilds do not
affect configurations and source code within the
even if the underlying image or its dependencies change.
username is defined in the image. See
Docker's image documentation
Organizations can set an auto-off inactivity threshold. After an environment hasn't been access for the specified threshold, it is shutdown. A stopped environment requires a rebuild before you can access it again.
Coder exposes a few hooks during the build process. Once an environment is available and running on an underlying host, the following steps are taken:
Injection of secrets into the environment: Coder injects authentication
for the Coder CLI, allowing the CLI to
perform authenticated CLI commands. If your Coder instance is configured with
a Git provider, your SSH key pair is injected during this step as well,
allowing it to perform authenticated
/coder/configure: Execution of this script allows
images to perform startup operations consistent across
all of the environments that use the image. If you need your image to include
/home, include the instructions in this script.
Execution of ~/personalize`: Execution of this script allows you to customize your personal development environment on each rebuild. Read more on personalization here.