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

Allow defaultGitImage to be a configurable value #2027

Closed
jschnitter opened this issue Jul 18, 2022 · 3 comments
Closed

Allow defaultGitImage to be a configurable value #2027

jschnitter opened this issue Jul 18, 2022 · 3 comments
Labels
type:enhancement Small feature requests / adjustments

Comments

@jschnitter
Copy link

We are testing earthly behind our corporate firewall that has no Internet access. We use artifactory as a pull through docker cache.

I am unable to use artifactory as a proper pull through cache because authentication details are not passed to docker, apparently because of this issue.

As an alternative to having an nginx frontend that can handle the authentication to our registry cache, I am hoping you'd be willing to allow the defaultGitImage to be an image that could be defined in ~/.earthly/config.yml.

I was able to verify git operations in earthly behind our firewall by building my own earthly docker image, changing the defaultGitImage in buildcontent/git.go to point to the same image in our artifactory instance, but would love to see this in the core earthly docker image so I don't have to build custom images from source.

Thanks for your consideration.

@alexcb
Copy link
Collaborator

alexcb commented Jul 18, 2022

That's awesome to hear you were able to rebuild it and it worked.

We'll accept a PR for such a feature; then once it's fixed upstream we could evaluate if it's still needed.

The gitImage could be moved into the gitResolver struct

type gitResolver struct {

which gets created via

gr: &gitResolver{

the NewResolver(...) function could be modified to take the gitImage string

b.resolver = buildcontext.NewResolver(opt.SessionID, opt.CleanCollection, opt.GitLookup, opt.Console, opt.FeatureFlagOverrides)
would have to be updated to pass the value in

type Opt struct {
would have to have a similar GitImage string added to it.

it gets set via

builderOpts := builder.Opt{

then finally a new ~/.earthly/config.yml option could be set under

type GlobalConfig struct {

which would then show up under build_cmd.go under app.cfg.GitImage.

I'll gladly help out if you run into any roadblocks along the way.

@alexcb alexcb added the type:enhancement Small feature requests / adjustments label Jul 18, 2022
@jschnitter
Copy link
Author

@alexcb -- I appreciate the detailed guide. Thank you. I'd be happy to take this on.

hojerst added a commit to hojerst/earthly that referenced this issue Dec 8, 2022
alexcb pushed a commit that referenced this issue Dec 29, 2022
This adds support to set the `gitImage` via an entry in the config file:

```yaml
global:
   git_image: my/gitimage:v1.2.3
```
@hojerst
Copy link
Contributor

hojerst commented Jan 2, 2023

this should be fixed/implemented now. (see above PR)

@alexcb alexcb closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Small feature requests / adjustments
Projects
None yet
Development

No branches or pull requests

3 participants