Skip to content

build-arg's not working for e2b template build command#644

Merged
mishushakov merged 2 commits intoe2b-dev:mainfrom
davidlbatey:patch-1
Mar 28, 2025
Merged

build-arg's not working for e2b template build command#644
mishushakov merged 2 commits intoe2b-dev:mainfrom
davidlbatey:patch-1

Conversation

@davidlbatey
Copy link
Copy Markdown
Contributor

At the moment if you pass in build args it breaks since the commands aren't compatible with the docker build command:

Sample error at the moment when passing the --build-arg to e2b which proxies the command on incorrectly:

(base) ➜  web git:(lb) ✗ npm run build-template template-name version

> new-nextjs-app@0.1.0 build-template
> ts-node scripts/build-template.ts template-name template-version sha

ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build
/bin/sh: line 4: --build-arg=TEMPLATE_VERSION=0.0.1: command not found
Error: Command failed: docker build . \
   -f e2b.Dockerfile \
   --pull --platform linux/amd64 \
   -t docker.e2b.dev/e2b/custom-envs/17e92ok9u0gimh3oy1qg:be0bdf11-4cf2-4ee0-a932-1ecb6ae50298 --build-arg="TEMPLATE_NAME=lead-magnet" \
   --build-arg="TEMPLATE_VERSION=0.0.1"
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at checkExecSyncError (node:child_process:889:11)
    at Object.execSync (node:child_process:961:15)
    at e.<anonymous> (/opt/homebrew/lib/node_modules/@e2b/cli/src/commands/template/build.ts:363:23) {
  status: 127,
  signal: null,
  output: [ null, null, null ],
  pid: 67925,
  stdout: null,
  stderr: null
}
Failed to build template: Error: Command failed: e2b template build -d "../../sandbox/templates/e2b.Dockerfile" -n template-name sha1 --build-arg TEMPLATE_NAME=template-name --build-arg TEMPLATE_VERSION=0.0.1 -p "../sandbox/templates/"
ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Breaks the docker builds when you pass in build-arg
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2025

🦋 Changeset detected

Latest commit: a7f6949

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@e2b/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ValentaTomas ValentaTomas added the bug Something isn't working label Mar 28, 2025
@mishushakov mishushakov merged commit e8fab56 into e2b-dev:main Mar 28, 2025
1 check passed
@mishushakov
Copy link
Copy Markdown
Member

Thank you for your contribution - I have merged it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants