Skip to content

Building a template that requires running commands like copy, fails #1036

@ItayElgazar

Description

@ItayElgazar

Describe the bug
A clear and concise description of what the bug is.

Trying to build a template both from a dockerfile using the .fromDockerfile or by using the function:

export const template = Template()
  .fromImage("e2bdev/base")
  .copy(".", "/workspace")
  .runCmd("pnpm install")
  .runCmd("pnpm run build")
  .runCmd("echo Hello World E2B!");

results in an error:

Error: EACCES: permission denied, open '/etc/sudoers'
    at Object.openSync (node:fs:561:18)
    at Object.readFileSync (node:fs:445:35)
    at calculateFilesHash ** REDACTED ** {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/etc/sudoers'
}

When running in sudo:

Error: ENOENT: no such file or directory, stat '/usr/lib/libz.1.2.12.dylib'
    at Object.statSync (node:fs:1739:25)
    at calculateFilesHash ***REDACTED*** {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/usr/lib/libz.1.2.12.dylib'
}

To Reproduce
Steps to reproduce the behavior:

  1. add a template like the above
  2. run pnpm run e2b:build:dev
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Browser console output
Console logs from your browser's developer tool console.

Terminal commands & output
Commands you used to start the app and the terminal output.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacBook Pro, M4 Max, 15.7.2 (24G325)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions