slimtoolkit/slim · error
no service image
Error message
no service image
What it means
ErrNoServiceImage is defined in pkg/app/master/compose/execution.go and signals that a compose service has no image to work with — the service definition lacks an image and no built image is available, so the compose execution cannot proceed for that service.
Source
Thrown at pkg/app/master/compose/execution.go:24
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"sync"
"time"
"github.com/slimtoolkit/slim/pkg/app"
"github.com/slimtoolkit/slim/pkg/docker/dockerutil"
"github.com/compose-spec/compose-go/loader"
"github.com/compose-spec/compose-go/types"
dockerapi "github.com/fsouza/go-dockerclient"
log "github.com/sirupsen/logrus"
)
var ErrNoServiceImage = errors.New("no service image")
type ServiceError struct {
Service string
Op string
Info string
}
func (e *ServiceError) Error() string {
return fmt.Sprintf("compose.ServiceError: service=%s op=%s info='%s'",
e.Service, e.Op, e.Info)
}
type ovars = app.OutVars
type ExecutionState string
const (
XSNone ExecutionState = "xs.none"View on GitHub (pinned to 81940d17fa)
Solutions
- Add an `image:` field to the service in the compose file
- Build the image first (docker compose build) so a local image exists before running the tool
- Verify you targeted the correct service name in the compose project
Example fix
# before
services:
app:
build: ./app
# after
services:
app:
build: ./app
image: myapp:latest Defensive patterns
Strategy: validation
Validate before calling
svc := project.Services["app"]
if svc.Image == "" {
return fmt.Errorf("service %q has no image; add an image: field or build first", "app")
} Prevention
- Always set image: alongside build: in compose services
- Run docker compose build before image-processing tools
- Double-check service names in the compose file
When it happens
Trigger: Running the compose execution/minification flow against a compose file whose service omits the `image` key and relies solely on a `build` section without a pre-built image present.
Common situations: Compose files that only specify build:; services expected to be built by an earlier step that was never run; typos in the service name in the compose file.
Related errors
- no project info
- unknown service - %s
- cant build service image - %s
- bad image reference
- invalid context directory - %s
AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31).
Data as JSON: /api/errors/baa13c06e0a0c32a.
Report an issue: GitHub.