Skip to content

feat(docker): exclude .iloom directory from Docker build context #936

@acreeger

Description

@acreeger

Problem

When building Docker images for dev server mode, the .iloom directory (containing config, prompts, metadata) is included in the build context. This is unnecessary — it bloats the context sent to the Docker daemon and could leak iloom-specific files into images.

Proposed Solution

Pipe a filtered tar archive to docker build via stdin instead of passing . as the build context:

tar -c --exclude='.iloom' -C /worktree . | docker build -t imageName -f ./Dockerfile -

In code, replace args.push('.') with args.push('-') and pipe a tar subprocess (with --exclude=.iloom) into docker's stdin:

const tar = execa('tar', ['-c', '--exclude=.iloom', '.'], { cwd: worktreePath })
await execa('docker', args, { stdin: tar.stdout, stdout: 'inherit', stderr: 'inherit' })

Why not .dockerignore?

  • Requires creating/modifying a user-controlled file
  • Would need cleanup logic and git status management
  • Doesn't work if the project already has a .dockerignore that gets overwritten

Why not --ignore?

Docker CLI has no --ignore flag for inline ignore patterns.

Files to change

  • src/lib/DockerDevServerStrategy.tsbuildImage() method
  • src/lib/DockerManager.tsbuildImage() static method

Notes

  • Verify execa v8 subprocess piping API (.pipe() or stdin option)
  • Docker reads -f ./Dockerfile relative to the tar context, so existing -f usage should work unchanged
  • stdio: 'inherit' for stdout/stderr must be preserved so build progress is visible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions