Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Ability to drop to an interactive shell via Earthfile #693

Closed
dchw opened this issue Jan 6, 2021 · 2 comments
Closed

Proposal: Ability to drop to an interactive shell via Earthfile #693

dchw opened this issue Jan 6, 2021 · 2 comments
Assignees
Labels
help:feedback-requested Issue requests feedback type:proposal A proposal for a new feature

Comments

@dchw
Copy link
Collaborator

dchw commented Jan 6, 2021

Introduce a new command that triggers the interactive debugger as a step. Once the shell session is complete; aggregate all changes made in the container and continue execution (including the modifications).

Here are the options I have thought of for syntax:

my-target:
    FROM alpine:latest
    INTERACTIVE SHELL
   ...
my-target:
    FROM alpine:latest
    DEBUG
    ...

Use-cases:

  • Explore problematic containers that otherwise build fine with Earthly
  • Debug at any state
  • Allow manual modification for development and/or testing while creating an Earth target
  • Enables a repl-like development cycle

Alternatives:

  • Right now, to get similar effects, you would need to insert a failing command (I usually use RUN breakhere); and then include the interactive debugging mode CLI argument. This is cumbersome and annoying; plus it does not allow for continuation after the fact (since something has already failed).
  • Build the image and explore it post-build using tools like dive. This lets you see the state of the filesystem at a given point; but its not easy to run commands at a given layer. Additionally; we are encumbered more by the lack of good layer descriptions in our built images right now.
@dchw dchw added the type:proposal A proposal for a new feature label Jan 6, 2021
@dchw dchw added the help:feedback-requested Issue requests feedback label Jan 6, 2021
@vladaionescu
Copy link
Member

Another possible syntax could be

RUN --interactive /bin/sh

Then you could also run arbitrary programs directly. Like RUN --interactive python or RUN --interactive node.

Possible extension: in interactive mode, also allow bind-mounting any local folder. This could enable watch mode use-case for front-end developers.

@leighst
Copy link

leighst commented Apr 26, 2023

Was this added ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help:feedback-requested Issue requests feedback type:proposal A proposal for a new feature
Projects
No open projects
Development

No branches or pull requests

3 participants