gitpod-io / dockerfreeze

Freeze your development environment as a Dockerfile
MIT License
12 stars 4 forks source link

Add all programs from $PATH #69

Open JesterOrNot opened 4 years ago

JesterOrNot commented 4 years ago

This iterates over $PATH and adds all folders/files from it. I have updated the CLI and GUI to allow for the option to opt-out of adding programs from $PATH.

fixes #7

JesterOrNot commented 4 years ago

Oh right...Build context...Hmm

JesterOrNot commented 4 years ago

What about a system like @Kreyren proposed where we use the package manager stating that but with the option to use $PATH for packages we find that weren't installed by the package manager and that it must be done from /

in Pseudocode Something like

IF !installedFromPackageManager THEN
    // Do stuff to install from $PATH
END
JesterOrNot commented 4 years ago

@Kreyren, thoughts?

Kreyren commented 4 years ago

For the UX i would output a path to where this dockerfile has been saved:

image

Same for CLI:

image

Kreyren commented 4 years ago

Does not seem to have proper checking for required dependencies

image

Kreyren commented 4 years ago

Generated dockerfile is mostly unreadable -> Add spaces?

image

Proposed:

ENV \
   BAZ=1
   BAR=1

or

ENV BAZ=1
ENV BAR=1
Kreyren commented 4 years ago
...
COPY /home/gitpod/.pyenv/versions/3.6.2/bin /home/gitpod/.pyenv/versions/3.6.2/bin
COPY /home/gitpod/.pyenv/libexec /home/gitpod/.pyenv/libexec
COPY /home/gitpod/.pyenv/plugins/python-build/bin /home/gitpod/.pyenv/plugins/python-build/bin
COPY /home/gitpod/.pyenv/plugins/pyenv-virtualenv/bin /home/gitpod/.pyenv/plugins/pyenv-virtualenv/bin
COPY /home/gitpod/.pyenv/plugins/pyenv-update/bin /home/gitpod/.pyenv/plugins/pyenv-update/bin
COPY /home/gitpod/.pyenv/plugins/pyenv-installer/bin /home/gitpod/.pyenv/plugins/pyenv-installer/bin
COPY /home/gitpod/.pyenv/plugins/pyenv-doctor/bin /home/gitpod/.pyenv/plugins/pyenv-doctor/bin
COPY /home/gitpod/.cargo/bin /home/gitpod/.cargo/bin
COPY /home/gitpod/.pyenv/plugins/pyenv-virtualenv/shims /home/gitpod/.pyenv/plugins/pyenv-virtualenv/shims
COPY /home/gitpod/.pyenv/shims /home/gitpod/.pyenv/shims
COPY /workspace/.cargo/bin /workspace/.cargo/bin
COPY /workspace/.pip-modules/bin /workspace/.pip-modules/bin
COPY /workspace/.rvm/bin /workspace/.rvm/bin
COPY /home/gitpod/.cargo/bin /home/gitpod/.cargo/bin
COPY /home/gitpod/.sdkman/candidates/maven/current/bin /home/gitpod/.sdkman/candidates/maven/current/bin
COPY /home/gitpod/.sdkman/candidates/java/current/bin /home/gitpod/.sdkman/candidates/java/current/bin
COPY /home/gitpod/.sdkman/candidates/gradle/current/bin /home/gitpod/.sdkman/candidates/gradle/current/bin
COPY /home/gitpod/.cargo/bin /home/gitpod/.cargo/bin
...

I would say that this has a likelyhood of breaking on runtime -> Implement a logic based on dockerimage used?

i.e if we need cargo on debian -> apt install -y cargo

EDIT: It would also make it practically unusable after an update.