atmos devcontainer rebuild
Use this command to rebuild a devcontainer from scratch. This stops and removes the existing container, pulls the latest image, and creates a new container.
Usage
atmos devcontainer rebuild <name> [flags]
Arguments
name- Name of the devcontainer to rebuild
Flags
--instance string- Instance name for this devcontainer (default:
default) --attach- Attach to the container after rebuilding
--no-pull- Don't pull the latest image before rebuilding
Examples
# Rebuild a devcontainer
atmos devcontainer rebuild geodesic
# Rebuild and attach
atmos devcontainer rebuild geodesic --attach
# Rebuild without pulling latest image
atmos devcontainer rebuild geodesic --no-pull
# Rebuild a specific instance
atmos devcontainer rebuild terraform --instance project-a
Behavior
- Stops the container if it's running
- Removes the existing container
- Pulls the latest image (unless
--no-pullis specified) - Creates a new container with the current configuration
- Starts the new container
- Optionally attaches to the container (if
--attachis specified)
Use Cases
- Configuration changes: After updating your
devcontainer.jsonoratmos.yaml - Image updates: To get the latest version of the base image
- Clean slate: When you want to start fresh without any accumulated state
Try it out
- Install Atmos
- Try the example
Copy the example into a new directory and make it your own:
atmos init examples/devcontainer-build
cd devcontainer-build
Requires a running Podman runtime (the example selects Podman) and network access for the image. The final commands clean up the local container.
atmos devcontainer rebuild geodesic
atmos devcontainer stop geodesic
atmos devcontainer remove geodesic