Skip to content

Conversation

dobrac
Copy link
Contributor

@dobrac dobrac commented Oct 14, 2025

Set default user for Dockerfiles. Includes also small migrate fixes.


Note

Defaults Dockerfile-based templates to user 'user' and workdir '/home/user', updates CLI templates (sudo start/ready, relative Python import), and allows template migration without a config file.

  • SDKs (Dockerfile parsing):
    • JS (packages/js-sdk/src/template/dockerfileParser.ts) and Python (packages/python-sdk/e2b/template/dockerfile_parser.py): after parsing, set defaults setUser('user') and setWorkdir('/home/user').
  • CLI Templates:
    • Python build scripts: switch to relative import from .template import template.
    • Generated template hbs: start/ready commands now prefixed with sudo; removed explicit root/workdir before start/ready.
  • CLI Migrate:
    • Supports migration without e2b.toml; uses default config values and prints a warning instead of exiting.
    • Initializes default config when missing; success messaging adjusted.
  • Tests:
    • Update fixtures to reflect new defaults (set_user('user'), set_workdir('/home/user'), sudo start/ready, relative imports).
    • Relax error case to succeed with warning when config is missing.
    • Comment out stacktrace tests for fromDockerfile in JS/Python until fixed.
  • Changesets: Patch bumps for @e2b/cli, @e2b/python-sdk, and e2b.

Written by Cursor Bugbot for commit 934dc3b. This will update automatically on new commits. Configure here.

Copy link

changeset-bot bot commented Oct 14, 2025

🦋 Changeset detected

Latest commit: 934dc3b

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

This PR includes changesets to release 3 packages
Name Type
@e2b/cli Patch
@e2b/python-sdk Patch
e2b 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

@dobrac dobrac changed the title Upgrade to latest 1.8.x version of poetry (#947) feat: set default user for Dockerfiles Oct 14, 2025
@dobrac dobrac changed the title feat: set default user for Dockerfiles feat: set default user and workdir for migration Oct 14, 2025
@dobrac dobrac changed the title feat: set default user and workdir for migration feat: set default user and workdir for Docker Oct 14, 2025
@dobrac dobrac changed the title feat: set default user and workdir for Docker feat: set default user and workdir when using Dockerfile Oct 14, 2025
@dobrac dobrac force-pushed the set-default-user-dockerfile branch from 1f8171b to 73cd236 Compare October 14, 2025 21:26
@dobrac dobrac marked this pull request as ready for review October 14, 2025 21:30
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Base automatically changed from figure-out-default-user-template-root-sandbox-user-eng-3049 to main October 15, 2025 07:23
cursor[bot]

This comment was marked as outdated.

Copy link
Member

@mishushakov mishushakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will check the tests, meanwhile change the relative import .template to absolute e2b.template

there is a bug, we'll fix it in future PR
@dobrac
Copy link
Contributor Author

dobrac commented Oct 15, 2025

i will check the tests, meanwhile change the relative import .template to absolute e2b.template

The relative .template is in fixtures. That should be correct there.

Commented out the fromDockerfile/from_dockerfile stacktraces tests for now as they're broken. We'll fix it in a future PR.

@jakubno jakubno merged commit 3046491 into main Oct 15, 2025
6 of 8 checks passed
@jakubno jakubno deleted the set-default-user-dockerfile branch October 15, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants