Conversation
Adds a new 'vers docker' command group with 'vers docker run' subcommand that: - Parses Dockerfiles and extracts instructions (FROM, RUN, COPY, WORKDIR, ENV, EXPOSE, CMD, ENTRYPOINT) - Creates a new Vers VM with configurable resources - Copies build context to the VM via SFTP - Executes RUN commands over SSH - Starts the application (CMD/ENTRYPOINT) Features: - Detached mode (-d) for background execution - Interactive mode (-i) for TTY support - Custom build context (-c) - VM aliasing (-N) - Environment variable passthrough (-e) - Configurable VM resources (--mem, --vcpu, --fs-size) This enables Docker-like workflows with Vers VM benefits: - Persistent state with snapshots - Branch and restore capabilities - Full SSH access - No container overhead
Extends Docker CLI compatibility with: docker build: - vers docker build -t myapp . - vers docker build -f Dockerfile.prod . - Creates a Vers commit (snapshot) from a Dockerfile - Cleans up build VM after commit docker compose up: - vers docker compose up - vers docker compose up -d - vers docker compose up web api - Parses docker-compose.yml files - Creates one Vers VM per service - Handles dependency ordering (topological sort) - Sets up inter-service environment variables This follows the pattern of 'uv pip' and 'jj git' - providing familiar CLI compatibility on top of a different underlying system.
- 'vers build --dockerfile' now delegates to 'vers docker build' handler - Shows deprecation warning when --dockerfile flag is used - Flag is marked deprecated and hidden from help output - Both commands now use the same underlying DockerBuildReq handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
vers dockercommand group that allows running Dockerfiles on Vers VMs instead of containers.New Commands
vers docker run [dockerfile]- Parse and execute a Dockerfile on a Vers VMvers docker build [context]- Build a Dockerfile as a Vers snapshot (commit)vers docker compose up- Start a compose project with each service as a VMDeprecation Notice
vers build --dockerfileis now deprecated in favor ofvers docker build.The old command still works but will show a deprecation warning:
Migration: Replace
vers build --dockerfile ./Dockerfilewithvers docker build -f ./Dockerfile .Features
Dockerfile Parsing
["cmd", "arg"]and shell format\Execution
Flags
-d, --detach- Run in background mode-i, --interactive- Run with TTY support-c, --context- Custom build context directory-N, --name- Set VM alias-e, --env- Pass additional environment variables--mem- Memory size in MiB (default: 1024)--vcpu- Number of vCPUs (default: 2)--fs-size- Filesystem size in MiB (default: 4096)Usage Examples
Benefits over Docker
The VM persists after completion, enabling:
vers connect <vm>- SSH into the environmentvers commit <vm>- Create a snapshotvers branch <vm>- Branch the statevers tunnel <vm> <port>- Forward portsTesting
Files Changed
cmd/docker.go- CLI command definitionscmd/build.go- Added deprecation for --dockerfile flaginternal/docker/parser.go- Dockerfile parserinternal/docker/parser_test.go- Parser testsinternal/docker/executor.go- Dockerfile executorinternal/handlers/docker_run.go- Handler logicinternal/handlers/docker_build.go- Build handler logicinternal/presenters/docker_presenter.go- Output formatting