Documentation
¶
Index ¶
- func FileExists(path string) bool
- func LoadEnvFile(filePath string) (map[string]string, error)
- type AddOptions
- type BuildOptions
- type Builder
- type ContainerRunOptions
- type DockerBuildOptions
- type Manager
- func (m *Manager) Add(opts AddOptions) (*types.Project, error)
- func (m *Manager) Build(opts BuildOptions) error
- func (m *Manager) Get(name string) (*types.Project, error)
- func (m *Manager) GetStatus(name string) (types.ServiceStatus, error)
- func (m *Manager) ImageExists(imageTag string) bool
- func (m *Manager) List() ([]*types.Project, error)
- func (m *Manager) Remove(name string, removeImage bool) error
- func (m *Manager) Restart(name string) error
- func (m *Manager) Run(opts RunOptions) error
- func (m *Manager) Start(name string) error
- func (m *Manager) Stop(name string) error
- type RunOptions
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddOptions ¶
type AddOptions struct {
ProjectPath string // Path to project directory
Name string // Project name (optional, defaults to directory name)
Dockerfile string // Path to Dockerfile (optional, defaults to ./Dockerfile)
Port int // Main port to expose
Ports []string // Additional port mappings
Environment map[string]string // Environment variables
Dependencies []string // Service dependencies (e.g., postgres:16)
Domain string // Custom domain (optional)
Internal bool // Internal only (no Traefik)
Replace bool // Replace existing project if it exists
}
AddOptions contains options for adding a project
type BuildOptions ¶
type BuildOptions struct {
Name string // Project name
NoCache bool // Build without cache
Pull bool // Pull base image before building
Tag string // Custom tag
BuildArgs map[string]string // Build arguments for ARG directives in Dockerfile (NOT runtime env vars)
}
BuildOptions contains options for building a project
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder handles Docker build operations for projects
func NewBuilder ¶
NewBuilder creates a new Docker builder
func (*Builder) Build ¶
func (b *Builder) Build(opts DockerBuildOptions) (string, error)
Build builds a Docker image from a Dockerfile Uses docker buildx for BuildKit support with SSH forwarding
func (*Builder) GetImageInfo ¶
func (b *Builder) GetImageInfo(imageTag string) (types.ImageInspect, error)
GetImageInfo retrieves information about a Docker image
func (*Builder) ValidateDockerfile ¶
ValidateDockerfile checks if a Dockerfile exists and is readable
type ContainerRunOptions ¶
ContainerRunOptions contains options for running a container
type DockerBuildOptions ¶
type DockerBuildOptions struct {
ContextPath string // Project directory path
DockerfilePath string // Path to Dockerfile
Tags []string // Image tags
NoCache bool // Build without cache
Pull bool // Pull base image
BuildArgs map[string]*string // Build arguments
}
DockerBuildOptions contains options for building a Docker image
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles project lifecycle operations
func NewManager ¶
NewManager creates a new project manager
func (*Manager) Add ¶
func (m *Manager) Add(opts AddOptions) (*types.Project, error)
Add adds a new project to Doku
func (*Manager) Build ¶
func (m *Manager) Build(opts BuildOptions) error
Build builds a project's Docker image
func (*Manager) GetStatus ¶
func (m *Manager) GetStatus(name string) (types.ServiceStatus, error)
GetStatus returns the current status of a project
func (*Manager) ImageExists ¶
ImageExists checks if a Docker image exists (public method)
type RunOptions ¶
type RunOptions struct {
Name string // Project name
Build bool // Build before running
InstallDeps bool // Auto-install dependencies
Detach bool // Run in background
}
RunOptions contains options for running a project
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner handles running project containers
func (*Runner) InstallDependencies ¶
InstallDependencies installs missing project dependencies
func (*Runner) PromptInstallDependencies ¶
PromptInstallDependencies prompts user to install missing dependencies
func (*Runner) Run ¶
func (r *Runner) Run(opts ContainerRunOptions) error
Run runs a project container