How to execute a shell command before the ENTRYPOINT via the dockerfile

Images are immutable Dockerfile defines the build process for an image. Once built, the image is immutable (cannot be changed). Runtime variables are not something that would be baked into this immutable image. So Dockerfile is the wrong place to address this. Using an entrypoint script What you probably want to to do is override … Read more

Can I hold git credentials in environment variables?

I know that it’s very old question but if you really need to pass username and password for HTTP basic authentication you can just set helper like this: git config credential.helper ‘!f() { sleep 1; echo “username=${GIT_USER}”; echo “password=${GIT_PASSWORD}”; }; f’ UPDATE: I’ve added sleep 1 to the function. In some environments it may be … Read more

Set LD_LIBRARY_PATH before importing in python

UPDATE: see the EDIT below. I would use: import os os.environ[‘LD_LIBRARY_PATH’] = os.getcwd() # or whatever path you want This sets the LD_LIBRARY_PATH environment variable for the duration/lifetime of the execution of the current process only. EDIT: it looks like this needs to be set before starting Python: Changing LD_LIBRARY_PATH at runtime for ctypes So … Read more

How can I globally set the PATH environment variable in VS Code?

If you only need the $PATH to be set in the integrated terminal, you can use VS Code’s terminal.integrated.env.<platform> variable (added in version 1.15). Press Cmd+Shift+P (or Ctrl+Shift+P) and search for “Preferences: Open Settings (JSON)”. Then add the following entry to the settings file: “terminal.integrated.env.osx”: { “PATH”: “…:/usr/bin:/bin:…” } (Replace .osx with .linux or .windows … Read more