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

Could we auto-generate a dockerfile while running walt image shell? #38

Open
eduble opened this issue Mar 12, 2019 · 2 comments
Open

Could we auto-generate a dockerfile while running walt image shell? #38

eduble opened this issue Mar 12, 2019 · 2 comments

Comments

@eduble
Copy link
Contributor

eduble commented Mar 12, 2019

Having walt images generated from a Dockerfile allows easier maintenance (e.g. regenerate the image when the base image is updated).
However, using walt image shell can be handy for more interactive modification.
Thus, having walt image shell auto-generate a Dockerfile could be handy.

We can imagine the following:

  • when walt image shell <image> is started, we check if a file [image_root]/etc/walt/Dockerfile exists. If not, we initialize it with a single line FROM <docker_image_id>.
  • By using a bash hook (see here and here), we catch all commands typed during the shell session, and append them as RUN commands in /etc/walt/Dockerfile.

Notes:

  • we might have to restrict this feature to images embedding the bash interpreter (unless we are able to implement such a hook with a basic sh interpreter)
  • the generated Dockerfile would probably have to be reworked for real usage (e.g. if you edited a file with vi, having RUN vi <file> in the Dockerfile will probably not be enough explicit). But it would probably be a useful starting point.
@eduble
Copy link
Contributor Author

eduble commented Mar 13, 2019

Default raspberry pi images can now partly implement this issue: drakkar-lig/walt-rpi-debian@6f58a46
However:

  • There is no knowledge about the source image (FROM line): the server python code should probably be modified to initialize the dockerfile.
  • Default images for PC should also include this change.

@eduble
Copy link
Contributor Author

eduble commented Sep 8, 2020

The update that was done at drakkar-lig/walt-rpi-debian@6f58a46 does not seem to work any more. It will have to be re-checked.

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

No branches or pull requests

1 participant