Skip to content

Commit ccb4ae9

Browse files
aledbfclaude
andcommitted
fix(cli)!: build a Dockerfile configuration in one build as the reference does
build and up built a Dockerfile configuration in two steps: the user's Dockerfile with --target <stage> (written as <Dockerfile>.devcontainer.build next to it when its final stage had no name), then, with Features, a second build FROM that image. The file in the workspace failed a read-only workspace and was left behind on an interrupted build, the intermediate image changed layering and the cache, and --push/--output were dropped from the base build. As the reference CLI's buildAndExtendImage, the CLI now writes one combined Dockerfile-with-features (the user's Dockerfile, its final stage named, then the dev_containers_target_stage stage that installs the Features and writes the devcontainer.metadata LABEL, or only the label with no Features) into the Features folder under the cache folder, and runs one build with --target dev_containers_target_stage. The Dockerfile and the build arguments are byte-identical to what v0.90.0 writes and runs for the same configurations. Features and the lockfile are resolved before the build, as in TS. The Go-only behavior carries over to the single build: --secrets-file and --ca-bundle secrets, a sibling <Dockerfile>.dockerignore (#969), the final stage's own devcontainer.metadata entries (#1225), and build contexts. build's hidden --omit-syntax-directive now takes effect. BREAKING CHANGE: up tags a Dockerfile configuration's image with Features vsc-<folder>-<hash>, as the official CLI does, instead of vsc-<folder>-<hash>-features; the build no longer writes <Dockerfile>.devcontainer.build into the workspace. docs/migration.md lists both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent dad66a7 commit ccb4ae9

13 files changed

Lines changed: 877 additions & 409 deletions

‎docs/DIVERGENCES.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ upstream issue it fixes.
157157
in the build context (upstream #969). This CLI copies the ignore file next to every
158158
Dockerfile it generates (`TestCopyDockerignore`,
159159
`TestBuildAndExtendComposeDockerfileService` in `internal/cli/compose_up_held_test.go`,
160-
and `TestE2E_SiblingDockerignore` in `internal/cli/e2e_fixes_test.go`).
160+
`TestBuildDockerfileKeepsTheSiblingDockerignore`, and `TestE2E_SiblingDockerignore` in `internal/cli/e2e_fixes_test.go`).
161161
- **A `LABEL devcontainer.metadata` in the Dockerfile is kept.** TS builds the image's
162162
metadata label from the base image's label and the configuration and writes it over the
163163
image, so a `LABEL devcontainer.metadata=…` written in the built stage of the user's
164164
Dockerfile is lost (upstream #1225). This CLI merges that stage's entries between the
165165
base image's and the configuration's (`TestStageLabelsDevcontainerMetadata` and
166-
`TestStageLabelsReadsTheNamedStage` in `internal/docker`, `TestDockerfileImageMetadata`
167-
in `internal/cli/build_held_test.go`).
166+
`TestStageLabelsReadsTheNamedStage` in `internal/docker`, `TestBuildDockerfileMetadataLabel`
167+
in `internal/cli/dockerfile_build_held_test.go`).
168168
- **`build --label` applies to a Docker Compose configuration.** `docker compose build`
169169
takes no labels, and TS drops `--label` for a Compose configuration without a word
170170
(upstream #930). This CLI applies the labels with one more build, `FROM <image>`, tagged

‎docs/migration.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ runs the official CLI is unaffected:
101101
matching container.
102102
- Features are staged under `<tmp>/devcontainercli-<user>/container-features/`,
103103
one folder per build, and that folder is kept as the official CLI keeps it.
104+
- A Dockerfile configuration's image is made by one `docker build`, as the
105+
official CLI makes it: the Dockerfile followed by the stage that installs the
106+
Features and writes the `devcontainer.metadata` label, written as
107+
`Dockerfile-with-features` into that Features folder and built with
108+
`--target dev_containers_target_stage`. Earlier releases built the Dockerfile
109+
first, wrote `<Dockerfile>.devcontainer.build` next to it when its last stage had
110+
no name (failing in a read-only workspace), and added the Features in a second
111+
build. `up` of a Dockerfile configuration with Features now tags the image
112+
`vsc-<folder>-<hash>`, not `vsc-<folder>-<hash>-features`; a script that looked
113+
the image up by the old name should use the new one.
104114
- When the workspace is a Git worktree and the configuration sets both
105115
`workspaceMount` and `workspaceFolder`, `up` no longer mounts the main
106116
repository's Git common directory, and `read-configuration` no longer reports

‎docs/parity/parity-matrix.yaml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,34 @@ initial_cases:
17791779
current_status: match
17801780
notes: "Without build.context the context is the Dockerfile's folder (utils.ts getDockerContextPath: parentURI(getDockerfilePath)), not the configuration's: COPY finds the file next to sub/Dockerfile. Go used the configuration's folder and the COPY failed."
17811781

1782+
- id: build.read-only-workspace-dockerfile-success
1783+
lane: runtime
1784+
command: build
1785+
priority: p1
1786+
docker_required: true
1787+
setup_cmd: "WORKSPACE=/tmp/parity-${PARITY_CASE_ID}-${PARITY_SIDE}; chmod -R u+w $WORKSPACE 2>/dev/null; rm -rf $WORKSPACE; mkdir -p $WORKSPACE/.devcontainer; printf '%s\\n' 'FROM alpine:3' 'RUN echo ok > /marker' > $WORKSPACE/.devcontainer/Dockerfile; printf '%s' '{\"build\":{\"dockerfile\":\"Dockerfile\"},\"remoteUser\":\"root\"}' > $WORKSPACE/.devcontainer/devcontainer.json; chmod -R a-w $WORKSPACE; echo WORKSPACE=$WORKSPACE"
1788+
ts_cmd: "build --workspace-folder ${WORKSPACE} --image-name parity-${PARITY_CASE_ID}-${PARITY_SIDE}"
1789+
verify_cmd: "cd ${WORKSPACE} && find . | sort; docker history --no-trunc --format '{{.CreatedBy}}' ${IMAGE_NAME}"
1790+
cleanup_cmd: "docker rmi -f parity-${PARITY_CASE_ID}-${PARITY_SIDE} >/dev/null 2>&1; chmod -R u+w /tmp/parity-${PARITY_CASE_ID}-${PARITY_SIDE} 2>/dev/null; rm -rf /tmp/parity-${PARITY_CASE_ID}-${PARITY_SIDE}; true"
1791+
asserts: [exit_code, stdout_normalized]
1792+
class: build-runtime
1793+
current_status: match
1794+
notes: "TS buildAndExtendImage (singleContainer.ts) builds a Dockerfile configuration in one docker build of Dockerfile-with-features, written into the Features folder under the cache folder: the user's Dockerfile with its final stage named, then FROM $_DEV_CONTAINERS_BASE_IMAGE AS dev_containers_target_stage with the devcontainer.metadata LABEL, built with --target dev_containers_target_stage. A read-only workspace builds, nothing is written into it, and the image history ends with that LABEL instruction. Go wrote <Dockerfile>.devcontainer.build next to the Dockerfile (failing here with permission denied), built it with --target <stage> and --label devcontainer.metadata=..., and added Features in a second build."
1795+
1796+
- id: up.read-only-workspace-dockerfile-success
1797+
lane: runtime
1798+
command: up
1799+
priority: p1
1800+
docker_required: true
1801+
setup_cmd: "WORKSPACE=/tmp/parity-${PARITY_CASE_ID}-${PARITY_SIDE}; chmod -R u+w $WORKSPACE 2>/dev/null; rm -rf $WORKSPACE; mkdir -p $WORKSPACE/.devcontainer; printf '%s\\n' 'FROM alpine:3' 'RUN echo ok > /marker' > $WORKSPACE/.devcontainer/Dockerfile; printf '%s' '{\"build\":{\"dockerfile\":\"Dockerfile\"},\"remoteUser\":\"root\"}' > $WORKSPACE/.devcontainer/devcontainer.json; chmod -R a-w $WORKSPACE; echo WORKSPACE=$WORKSPACE"
1802+
ts_cmd: "up --workspace-folder ${WORKSPACE} --id-label parity.case=${PARITY_CASE_ID}-${PARITY_SIDE}"
1803+
verify_cmd: "cd ${WORKSPACE} && find . | sort; docker exec ${CONTAINER_ID} cat /marker; I=$(docker inspect -f '{{.Image}}' ${CONTAINER_ID}); docker history --no-trunc --format '{{.CreatedBy}}' $I"
1804+
cleanup_cmd: "I=$(docker inspect -f '{{.Image}}' ${CONTAINER_ID} 2>/dev/null); docker rm -f ${CONTAINER_ID} >/dev/null 2>&1; [ -n \"$I\" ] && docker rmi -f $I >/dev/null 2>&1; chmod -R u+w /tmp/parity-${PARITY_CASE_ID}-${PARITY_SIDE} 2>/dev/null; rm -rf /tmp/parity-${PARITY_CASE_ID}-${PARITY_SIDE}; true"
1805+
asserts: [exit_code, stdout_normalized]
1806+
class: up-runtime
1807+
current_status: match
1808+
notes: "As build.read-only-workspace-dockerfile-success, for up: one build of Dockerfile-with-features from the cache folder, so a read-only workspace starts and holds only what it held. Go failed writing <Dockerfile>.devcontainer.build into the workspace."
1809+
17821810
- id: upgrade.write-lockfile-to-disk-success
17831811
lane: runtime
17841812
command: upgrade

‎internal/cli/build.go‎

Lines changed: 13 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type buildOpts struct {
4444
secretsFile string
4545
secrets fileSecrets
4646
caBundle string
47+
omitSyntaxDirective bool
4748
lockfileExcludeIDs map[string]bool
4849
}
4950

@@ -92,7 +93,7 @@ func newBuildCmd() *cobra.Command {
9293
f.BoolVar(&opts.frozenLockfile, "frozen-lockfile", false, "Ensure lockfile exists and remains unchanged; fail otherwise.")
9394
f.StringVar(&opts.secretsFile, "secrets-file", "", "Path to a JSON file with build secrets ({\"KEY\":\"VALUE\"}); each is passed to BuildKit as a build secret (requires buildx).")
9495
f.StringVar(&opts.caBundle, "ca-bundle", "", caBundleFlagUsage)
95-
f.Bool("omit-syntax-directive", false, "")
96+
f.BoolVar(&opts.omitSyntaxDirective, "omit-syntax-directive", false, "")
9697
cmd.Flags().MarkHidden("skip-feature-auto-mapping")
9798
cmd.Flags().MarkHidden("skip-persisting-customizations-from-features")
9899
cmd.Flags().MarkHidden("experimental-lockfile")
@@ -267,15 +268,6 @@ func buildFlagConflict(opts *buildOpts, useBuildx, compose bool) string {
267268
return ""
268269
}
269270

270-
type dockerfileBuildPrep struct {
271-
Path string
272-
StageName string
273-
Parsed *docker.Dockerfile
274-
cleanup func()
275-
}
276-
277-
func (p *dockerfileBuildPrep) Cleanup() { p.cleanup() }
278-
279271
// copyDockerignore copies a Dockerfile's sibling `<name>.dockerignore` next to a
280272
// renamed/generated build Dockerfile, so BuildKit's per-Dockerfile ignore lookup
281273
// (`<dockerfile>.dockerignore`) still finds the user's rules instead of leaking
@@ -307,132 +299,21 @@ func dockerContextPath(cfg *config.DevContainer) string {
307299
return filepath.Dir(dockerfileConfigPath(cfg))
308300
}
309301

310-
func prepareDockerfileBuild(cfg *config.DevContainer) (*dockerfileBuildPrep, error) {
311-
dockerfilePath := cfg.Dockerfile()
312-
if dockerfilePath == "" {
313-
return nil, fmt.Errorf("no Dockerfile specified")
314-
}
315-
dockerfilePath = dockerfileConfigPath(cfg)
316-
317-
content, err := os.ReadFile(dockerfilePath)
318-
if err != nil {
319-
return nil, fmt.Errorf("read Dockerfile: %w", err)
320-
}
321-
322-
prep := &dockerfileBuildPrep{
323-
Parsed: docker.ExtractDockerfile(string(content)),
324-
cleanup: func() {},
325-
}
326-
327-
if cfg.Build != nil && cfg.Build.Target != "" {
328-
prep.StageName = cfg.Build.Target
329-
} else {
330-
stageName, modified, err := docker.EnsureFinalStageName(string(content), "dev_container_auto_added_stage_label")
331-
if err != nil {
332-
return nil, err
333-
}
334-
prep.StageName = stageName
335-
if modified != "" {
336-
tmpDockerfile := dockerfilePath + ".devcontainer.build"
337-
// mutate-exempt: only the docker build this process starts reads the file, as its owner, and Cleanup removes it
338-
if err := os.WriteFile(tmpDockerfile, []byte(modified), 0644); err != nil {
339-
return nil, fmt.Errorf("write build dockerfile: %w", err)
340-
}
341-
copyDockerignore(dockerfilePath, tmpDockerfile)
342-
prep.cleanup = func() {
343-
os.Remove(tmpDockerfile)
344-
os.Remove(tmpDockerfile + ".dockerignore")
345-
}
346-
dockerfilePath = tmpDockerfile
347-
}
348-
}
349-
350-
prep.Path = dockerfilePath
351-
return prep, nil
352-
}
353-
354-
// mutate-lane: TestParityMatrix (build.dockerfile-multi-image-success,
355-
// build.subfolder-config-success, build.apply-build-options-success,
356-
// build.output-oci-success, build.cache-to-local-success,
357-
// build.platform-supported-dockerfile-success), also run by
302+
// mutate-lane: TestBuildDockerfileBuildsOnce and TestParityMatrix
303+
// (build.dockerfile-multi-image-success, build.subfolder-config-success,
304+
// build.apply-build-options-success, build.output-oci-success,
305+
// build.cache-to-local-success, build.platform-supported-dockerfile-success,
306+
// build.read-only-workspace-dockerfile-success), also run by
358307
// TestE2E_BuildUpExec_Dockerfile, TestE2E_SiblingDockerignore and
359308
// TestE2E_CABundle (an opted-in RUN reads the bundle).
360309
func (r *buildRunner) buildDockerfile(ctx context.Context, cfg *config.DevContainer, loadResult *config.LoadResult, useBuildx bool) ([]string, error) {
361-
logger, dockerClient, engine, opts := r.log, r.docker, r.engine, r.opts
362-
363-
prep, err := prepareDockerfileBuild(cfg)
364-
if err != nil {
365-
return nil, err
366-
}
367-
defer prep.Cleanup()
368-
dockerfilePath := prep.Path
369-
stageName := prep.StageName
370-
371-
findTarget := ""
372-
if cfg.Build != nil {
373-
findTarget = cfg.Build.Target
374-
}
375-
baseImage := docker.FindBaseImage(prep.Parsed, buildArgsFromConfig(cfg), findTarget, buildxPlatformArgs(opts.platform))
376-
logger.Write(fmt.Sprintf("Base image: %s", baseImage), log.LevelInfo)
377-
378-
baseLabels := engine.ImageLabelsEnsuringPresent(ctx, baseImage)
379-
baseMetadata := imagemeta.ReadMetadataFromLabels(baseLabels, logger)
380-
stageMetadata := imagemeta.ReadMetadataFromLabels(prep.Parsed.StageLabels(stageName), logger)
381-
310+
opts := r.opts
311+
fb := r.featureBuildOptions(cfg, &loadResult.HostSub)
312+
fb.Secrets = opts.secrets.env()
382313
imageNames := imageNamesOr(opts.imageNames, folderImageName(resolvePath(opts.workspaceFolder)))
383-
384-
contextPath := dockerContextPath(cfg)
385-
386-
buildArgs := buildArgsFromConfig(cfg)
387-
388-
allLabels := append(slices.Clone(opts.labels), imageLabelArgs(dockerfileImageMetadata(cfg, baseMetadata, stageMetadata, r.configLabel))...)
389-
390-
baseOutput, basePush := dockerfileBaseExport(opts, cfg)
391-
392-
cacheFrom := cacheFromForDockerfileBuild(opts.cacheFrom, cfg)
393-
authEnv, authCleanup := bridgeBuildAuth(logger, baseImage, imageNames, cacheFrom, opts.cacheTo)
394-
defer authCleanup()
395-
396-
buildSecrets := buildxSecrets(opts.secrets.env(), useBuildx, logger)
397-
caSecrets := caBundleBuildSecrets(opts.caBundle, useBuildx, logger)
398-
399-
buildOpts := docker.BuildOptions{
400-
Dockerfile: dockerfilePath,
401-
ContextPath: contextPath,
402-
Tags: imageNames,
403-
Target: stageName,
404-
BuildArgs: buildArgs,
405-
CacheFrom: cacheFrom,
406-
Labels: allLabels,
407-
NoCache: opts.noCache,
408-
ExtraArgs: buildOptionsFromConfig(cfg),
409-
UseBuildx: useBuildx,
410-
Platform: opts.platform,
411-
Push: basePush,
412-
Output: baseOutput,
413-
CacheTo: opts.cacheTo,
414-
Env: authEnv,
415-
Secrets: buildSecrets,
416-
FileSecrets: caSecrets,
417-
}
418-
419-
result, err := dockerClient.Build(ctx, buildOpts)
420-
if err != nil {
314+
if err := buildDockerfileImage(ctx, r.log, r.docker, r.engine, cfg, useBuildx, imageNames, opts.platform, fb); err != nil {
421315
return nil, err
422316
}
423-
if result.ExitCode != 0 {
424-
return nil, fmt.Errorf(msgDockerBuildFailed, result.ExitCode, string(result.Stderr))
425-
}
426-
427-
if dockerClient.ProgressWriter == nil {
428-
logger.Write(string(result.Stderr), log.LevelInfo)
429-
}
430-
431-
if len(cfg.Features) > 0 {
432-
baseImageName := imageNames[0]
433-
return extendImageWithFeatures(ctx, logger, dockerClient, engine, baseImageName, cfg.Features, useBuildx, imageNames, r.featureBuildOptions(cfg, &loadResult.HostSub))
434-
}
435-
436317
return imageNames, nil
437318
}
438319

@@ -593,26 +474,6 @@ func imageNamesOr(names []string, fallback string) []string {
593474
return names
594475
}
595476

596-
// dockerfileImageMetadata is the metadata a Dockerfile build stamps on its
597-
// image: the base image's, then a `LABEL devcontainer.metadata` the user's
598-
// Dockerfile declares (#1225; the CLI's own label would otherwise clobber it),
599-
// then the config's entry as written (configLabel). With Features the Feature
600-
// build appends that entry instead.
601-
func dockerfileImageMetadata(cfg *config.DevContainer, base, stage []imagemeta.Entry, configLabel imagemeta.Entry) []imagemeta.Entry {
602-
metadata := append(append([]imagemeta.Entry{}, base...), stage...)
603-
if len(cfg.Features) == 0 {
604-
metadata = append(metadata, configLabel)
605-
}
606-
return metadata
607-
}
608-
609-
func dockerfileBaseExport(opts *buildOpts, cfg *config.DevContainer) (output string, push bool) {
610-
if len(cfg.Features) > 0 {
611-
return "", false
612-
}
613-
return opts.output, opts.push
614-
}
615-
616477
func buildxSecrets(secrets []string, useBuildx bool, logger log.Logger) []string {
617478
if useBuildx {
618479
return secrets
@@ -746,6 +607,7 @@ func (r *buildRunner) buildCompose(ctx context.Context, cfg *config.DevContainer
746607
noLockfile: opts.noLockfile,
747608
lockfileExcludeIDs: opts.lockfileExcludeIDs,
748609
caBundle: opts.caBundle,
610+
omitSyntaxDirective: opts.omitSyntaxDirective,
749611
},
750612
substitute: hostMetadataSubstitution(loadResult.HostSub, nil),
751613
configLabel: r.configLabel,
@@ -840,5 +702,6 @@ func (r *buildRunner) featureBuildOptions(cfg *config.DevContainer, hostSub *con
840702
WorkspaceFolder: opts.workspaceFolder,
841703
AdditionalMetadata: []imagemeta.Entry{configToMetadataEntry(cfg)},
842704
LabelMetadata: []imagemeta.Entry{r.configLabel},
705+
OmitSyntaxDirective: opts.omitSyntaxDirective,
843706
}
844707
}

‎internal/cli/build_held_test.go‎

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"testing"
1212

1313
"github.com/devcontainers/cli/internal/config"
14-
"github.com/devcontainers/cli/internal/imagemeta"
1514
"github.com/devcontainers/cli/internal/log"
1615
)
1716

@@ -132,40 +131,6 @@ func TestImageNamesOr(t *testing.T) {
132131
}
133132
}
134133

135-
func TestDockerfileImageMetadata(t *testing.T) {
136-
base := []imagemeta.Entry{{ID: "base"}}
137-
stage := []imagemeta.Entry{{ID: "stage"}}
138-
ids := func(entries []imagemeta.Entry) []string {
139-
var out []string
140-
for _, e := range entries {
141-
out = append(out, e.ID+"/"+e.RemoteUser)
142-
}
143-
return out
144-
}
145-
146-
cfg := &config.DevContainer{RemoteUser: "dev"}
147-
configLabel := imagemeta.Entry{RemoteUser: "${localEnv:USER}"}
148-
if got, want := ids(dockerfileImageMetadata(cfg, base, stage, configLabel)), []string{"base/", "stage/", "/${localEnv:USER}"}; !slices.Equal(got, want) {
149-
t.Errorf("without features: %v, want %v (the config's entry as written)", got, want)
150-
}
151-
152-
cfg.Features = map[string]any{"ghcr.io/devcontainers/features/go:1": true}
153-
if got, want := ids(dockerfileImageMetadata(cfg, base, stage, configLabel)), []string{"base/", "stage/"}; !slices.Equal(got, want) {
154-
t.Errorf("with features (the Feature build adds the config entry): %v, want %v", got, want)
155-
}
156-
}
157-
158-
func TestDockerfileBaseExport(t *testing.T) {
159-
opts := &buildOpts{output: "type=oci,dest=x.tar", push: true}
160-
if output, push := dockerfileBaseExport(opts, &config.DevContainer{}); output != opts.output || !push {
161-
t.Errorf("without features: (%q, %v), want the flags", output, push)
162-
}
163-
withFeature := &config.DevContainer{Features: map[string]any{"ghcr.io/devcontainers/features/go:1": true}}
164-
if output, push := dockerfileBaseExport(opts, withFeature); output != "" || push {
165-
t.Errorf("with features: (%q, %v), want them left to the Feature build", output, push)
166-
}
167-
}
168-
169134
func TestBuildxSecrets(t *testing.T) {
170135
secrets := []string{"TOKEN=x"}
171136
var logged bytes.Buffer
@@ -222,33 +187,6 @@ func TestRunBuildBuildKitNeverIgnoresBuildx(t *testing.T) {
222187
}
223188
}
224189

225-
func TestPrepareDockerfileBuildStage(t *testing.T) {
226-
ws := writeConfigFixture(t, map[string]string{
227-
".devcontainer/Dockerfile": "FROM alpine:3 AS base\nFROM base\n",
228-
".devcontainer/Empty": "RUN true\n",
229-
})
230-
cfgFile := filepath.Join(ws, ".devcontainer", "devcontainer.json")
231-
prep, err := prepareDockerfileBuild(&config.DevContainer{ConfigFilePath: cfgFile, Build: &config.Build{Dockerfile: "Dockerfile", Target: "base"}})
232-
if err != nil || prep.StageName != "base" {
233-
t.Fatalf("with a target: %+v, %v; want stage base", prep, err)
234-
}
235-
prep.Cleanup()
236-
prep, err = prepareDockerfileBuild(&config.DevContainer{ConfigFilePath: cfgFile, Build: &config.Build{Dockerfile: "Dockerfile"}})
237-
if err != nil || prep.StageName != "dev_container_auto_added_stage_label" {
238-
t.Fatalf("without a target: %+v, %v", prep, err)
239-
}
240-
if _, err := os.Stat(prep.Path); err != nil {
241-
t.Fatalf("named Dockerfile: %v", err)
242-
}
243-
prep.Cleanup()
244-
if _, err := os.Stat(prep.Path); !os.IsNotExist(err) {
245-
t.Errorf("named Dockerfile %s left after Cleanup: %v", prep.Path, err)
246-
}
247-
if _, err := prepareDockerfileBuild(&config.DevContainer{ConfigFilePath: cfgFile, Build: &config.Build{Dockerfile: "Empty"}}); err == nil || !strings.Contains(err.Error(), "no FROM instructions") {
248-
t.Errorf("no FROM: err = %v", err)
249-
}
250-
}
251-
252190
func TestBuildResultImageName(t *testing.T) {
253191
for _, tc := range []struct {
254192
name string

0 commit comments

Comments
 (0)