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

FEATURE | custom Toolbox image managed by CLI in a per user basis #265

Open
juanmatias opened this issue May 6, 2024 · 0 comments
Open

Comments

@juanmatias
Copy link
Contributor

juanmatias commented May 6, 2024

Disclaimer

I'm adding this here, but also affects the Toolbox repository. My decision is based on the fact the code to achieve this has to be in the CLI.

Describe the Feature

Based on the fact that each client has their own needs, e.g. kubectl or terraform version, some specific tools such as sops or helm... instead of having one Toolbox image the proposal is to perform a one-time build the first time the client uses Leverage CLI in a project (also a re build has to be available).

Expected Behavior

When a user creates a project, a set of configurations should be in place. So the user can change this configuration. E.g.:

tools:
  terraform:
    enabled: true
    version: 1.3.5
  kubectl:
    enabled: true
    version: 1.28
  sops:
    enabled: false
  helm:
    enabled: false

So, when the user starts the project this can be configured. Then, with some of the first Leverage commands (e.g. leverage project create or leverage image build) the image is built.

Also, here the custom user can be added, taking the UID and GID from the environment. This way we can get rid of the chown process inside the container.

Use Case

Different users with different needs do not need to have all the available tools in the Toolbox image.

Describe Ideal Solution

Be able to have automated custom solutions.

Alternatives Considered

  • create images containing all the tools
  • create different images and let the user choose

Additional Context

I have created a custom image for my own. With a custom user having my own UID/GID.

Since this user is other than root the home folder is not /root anymore.

But different users can have different names and IDs.

So, I created a common home dir inside the container: /opt/home

This way I can use this dir to install stuff or copy credential files such as AWS or SSH.

To do this I changed the /root/ references in Leverage code to /opt/home/.

Also, in my custom solution (in my Dockerfile based on the Leverage Toolbox image), I used asdf to install different tools and versions and to set them globally as default inside the container.

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

No branches or pull requests

1 participant