container-layerlisted
Install: claude install-skill oaustegard/claude-skills
# Container Layer
Build a reproducible, cached environment overlay for ephemeral containers using a Dockerfile-like spec.
## Concept
The container resets every session, but your environment shouldn't. This skill:
1. Parses a `Containerfile` (Dockerfile subset) that declares your environment
2. Caches the built result as a tarball in GitHub Releases
3. Restores from cache on subsequent boots (single fetch vs. N installs)
4. Provides a `uv` shim that captures ad-hoc installs back into the Containerfile
## Supported Containerfile Instructions
```dockerfile
# Environment variables
ENV KEY=value
# Shell commands (including package installs)
RUN apt-get install -y foo # system packages
RUN uv pip install pandas numpy # Python packages (preferred)
RUN pip install requests # also works
# Fetch files from URLs or GitHub
FETCH https://example.com/file.tar.gz /dest/path
FETCH github:user/repo /dest/path # latest tarball
FETCH github:user/repo@ref /dest/path # specific ref
# Set working directory for subsequent RUN commands
WORKDIR /some/path
# Declare paths to include in the cached layer snapshot
# (auto-detected for FETCH destinations and pip/uv installs)
SNAPSHOT /additional/path/to/capture
# Ignored (Dockerfile compat, no-op here):
# FROM, EXPOSE, CMD, ENTRYPOINT, LABEL, ARG, VOLUME, USER, SHELL
```
## Usage
### Single layer — build / restore
```python
from scripts.containerfile import ContainerLayer
layer = ContainerLayer(
co