Skip to main content

Overview

Dockhand’s file browser provides a web-based interface for managing files inside running containers and Docker volumes. Browse directories, edit files, upload/download content, and manage permissions without shell access.

Container File Browser

Browsing Container Files

Access the filesystem of any running container:
Response:

Implementation

File Operations

Reading File Content

Read the contents of a text file:
Response:

Writing File Content

Update or create a file:

File Size Limits

Creating Files/Directories

Or create a file:

Deleting Files

Renaming Files

Changing Permissions

File Upload/Download

Uploading Files

Upload one or more files to a container:
The implementation creates a TAR archive for Docker API:

Downloading Files

Returns the file as a download with appropriate Content-Disposition header.

Volume File Browser

Browsing Volume Files

Browse files in a Docker volume:
Response:

Volume Browser Implementation

Volumes are accessed through temporary helper containers:

Helper Container Lifecycle

  1. On first browse request: Create a temporary container with volume mounted
  2. Subsequent requests: Reuse the same container (cached for 30 minutes)
  3. Automatic cleanup: Helper containers are removed after TTL expires
  4. Manual cleanup: Helper containers can be released immediately

Release Helper Container

Manually release the helper container to free resources immediately.

File Editor Integration

The frontend integrates a code editor (Monaco/CodeMirror) for editing files:

Supported File Types

  • Configuration: JSON, YAML, TOML, INI
  • Code: JavaScript, TypeScript, Python, Go, Rust, Java
  • Markup: HTML, XML, Markdown
  • Styles: CSS, SCSS, LESS
  • Shell: Bash, Zsh, Shell scripts
  • Logs: Plain text with syntax highlighting

Editor Features

  • Syntax highlighting
  • Auto-completion
  • Line numbers
  • Search and replace
  • Multiple cursor support
  • Bracket matching
  • Code folding
  • Diff view (compare with previous version)

Security Considerations

Permission Requirements

Container Requirements

File operations only work on running containers:

Read-Only Volumes

Volumes mounted read-only cannot be modified:
Attempting to write will fail:

Common Use Cases

Editing Configuration

  1. Navigate to container’s config directory
  2. Open configuration file
  3. Edit in web-based editor
  4. Save changes
  5. Restart container if needed

Viewing Logs

  1. Browse to log directory
  2. Open log file
  3. Search for errors or patterns
  4. Download for local analysis

Uploading Certificates

  1. Navigate to certificate directory (e.g., /etc/ssl/certs)
  2. Upload new certificate files
  3. Set appropriate permissions (644 for certs, 600 for keys)
  4. Reload or restart service

Backup Configuration

  1. Browse to application directory
  2. Download configuration files
  3. Store locally or in version control
  4. Restore by uploading when needed

Debugging

  1. Check application files for corruption
  2. Verify configuration syntax
  3. Inspect generated files
  4. Compare with known good versions

Best Practices

File Operations

  1. Always backup before making changes
  2. Test changes in non-production first
  3. Use version control for configuration files
  4. Set proper permissions after uploads
  5. Validate syntax before saving configs

Volume Management

  1. Release helper containers when done browsing
  2. Use read-only mode for volumes in use
  3. Avoid large file operations (>100MB) through browser
  4. Download volumes for backup instead of browsing

Security

  1. Limit file browser access to authorized users
  2. Audit file changes through activity logs
  3. Never edit files containing secrets through browser
  4. Use proper file permissions (644 for files, 755 for scripts)
  5. Rotate secrets after viewing in file browser

Limitations

File Size Limits

  • Reading: 1MB maximum for text files
  • Uploading: Limited by browser and server settings
  • Editing: Large files may cause browser performance issues

Container State

  • Requires running containers
  • Cannot access stopped containers
  • Cannot access containers without shell

File System Support

  • Works with standard Linux filesystems
  • May have issues with special filesystems (proc, sys, dev)
  • Binary files display as download only

Troubleshooting

Permission Denied

Solutions:
  1. Check container user permissions
  2. Use chmod endpoint to fix permissions
  3. Exec into container as root if needed

Container Not Running

Solution: Start the container before accessing files

File Too Large

Solutions:
  1. Download file for local editing
  2. Use terminal/exec for large file operations
  3. Split file into smaller chunks

Volume Browse Timeout

Solutions:
  1. Check if volume exists
  2. Release and retry helper container
  3. Verify volume is not corrupted

API Reference

Container Files

Volume Files