{"record":{"id":"30c3794d49cf1d7f","repo":"slimtoolkit/slim","slug":"custom-base-images-are-not-supported-yet","errorCode":null,"errorMessage":"custom base images are not supported yet","messagePattern":"custom base images are not supported yet","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/imagebuilder/internalbuilder/engine.go","lineNumber":78,"sourceCode":"\n\tif len(options.Layers) > 255 {\n\t\treturn nil, fmt.Errorf(\"too many layers\")\n\t}\n\n\tswitch options.ImageConfig.Architecture {\n\tcase \"\":\n\t\toptions.ImageConfig.Architecture = \"amd64\"\n\tcase \"arm64\", \"amd64\":\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"bad architecture value\")\n\t}\n\n\tvar img v1.Image\n\tif options.From == \"\" {\n\t\t//same as FROM scratch\n\t\timg = empty.Image\n\t} else {\n\t\treturn nil, fmt.Errorf(\"custom base images are not supported yet\")\n\t}\n\n\timgRunConfig := v1.Config{\n\t\tUser:            options.ImageConfig.Config.User,\n\t\tExposedPorts:    options.ImageConfig.Config.ExposedPorts,\n\t\tEnv:             options.ImageConfig.Config.Env,\n\t\tEntrypoint:      options.ImageConfig.Config.Entrypoint,\n\t\tCmd:             options.ImageConfig.Config.Cmd,\n\t\tVolumes:         options.ImageConfig.Config.Volumes,\n\t\tWorkingDir:      options.ImageConfig.Config.WorkingDir,\n\t\tLabels:          options.ImageConfig.Config.Labels,\n\t\tStopSignal:      options.ImageConfig.Config.StopSignal,\n\t\tArgsEscaped:     options.ImageConfig.Config.ArgsEscaped,\n\t\tAttachStderr:    options.ImageConfig.Config.AttachStderr,\n\t\tAttachStdin:     options.ImageConfig.Config.AttachStdin,\n\t\tAttachStdout:    options.ImageConfig.Config.AttachStdout,\n\t\tDomainname:      options.ImageConfig.Config.Domainname,\n\t\tHostname:        options.ImageConfig.Config.Hostname,","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/imagebuilder/internalbuilder/engine.go#L60-L96","documentation":"The internal build engine can only build from an empty base image (equivalent to FROM scratch). If SimpleBuildOptions.From is set to any non-empty base image reference, Build returns this error immediately. Custom/foreign base images are simply not implemented in this engine yet.","triggerScenarios":"Calling Engine.Build with SimpleBuildOptions.From set to e.g. \"alpine:3.18\", \"ubuntu:22.04\", or any other image reference instead of leaving it empty.","commonSituations":"Users converting Dockerfiles that start FROM debian/alpine and expect the slim builder to honor the base image; build tooling that always populates From from a parsed Dockerfile.","solutions":["Leave SimpleBuildOptions.From empty (\"\") so the image is built from scratch and all needed files are supplied via Layers","Pre-package the base image's root filesystem content into a tar/dir layer yourself","Use a full-featured builder (docker build/buildx/ko) when a real base image is required","Check whether a newer version of the tool added base-image support"],"exampleFix":"// before\nopts.From = \"alpine:3.18\"\nimg, err := engine.Build(opts)\n// after\nopts.From = \"\" // build FROM scratch; supply rootfs content via Layers\nimg, err := engine.Build(opts)","handlingStrategy":"validation","validationCode":"if opts.From != \"\" {\n    return fmt.Errorf(\"internal builder only supports FROM scratch; unset From (%q)\", opts.From)\n}","typeGuard":null,"tryCatchPattern":"if _, err := engine.Build(opts); err != nil {\n    if strings.Contains(err.Error(), \"custom base images are not supported\") {\n        opts.From = \"\"\n        // pre-bake base rootfs into a layer, then retry\n    }\n    return err\n}","preventionTips":["Never populate From for this engine","Package any base-image rootfs as an explicit layer","Use docker build/buildx for cases requiring real base images"],"tags":["imagebuild","base-image","unsupported-feature","from-scratch"],"backgroundTag":"unsupported-feature","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}