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

Official Docker image? #4613

Open
3 of 4 tasks
kachkaev opened this issue Aug 19, 2019 · 15 comments
Open
3 of 4 tasks

Official Docker image? #4613

kachkaev opened this issue Aug 19, 2019 · 15 comments
Assignees
Labels

Comments

@kachkaev
Copy link

kachkaev commented Aug 19, 2019

Preliminary Steps

Please confirm you have...

Problem Description

I'm using linguist from a Node.js project and have almost zero knowledge in Ruby, Ruby Gem and so on. To me github-linguist is just a CLI command I know how to call.

const { stdout } = await execa("github-linguist", ["--json"], {
  cwd: sourceDir,
});

Installing github-linguist locally on Mac OS is not a big deal, however this becomes quite a challenge if I want to call the same command from CI. We use Azure DevOps, in which hosted agents do not come with Ruby. This means that every time I want to run a JavaScript command that depends on github-linguist I need to start the CI Job with this:

Screenshot 2019-08-19 at 15 54 11

Note that the task called Install linguist takes nearly 10 minutes. This is a simple call of gem install github-linguist.

It would be great if github-linguist was made available as an official docker image that I could invoke instead of obtaining Ruby and calling gem install. The CLI command would look something like:

const { stdout } = await execa("docker", [
  "run",
  "--rm",
  "--volume=${sourceDir}:/src",
  "github-linguist:alpine",
  "--json",
]);

Pulling a docker image and spinning a one-off docker container would take seconds, so a lot of CI time would be saved.

There already exists a third-party docker wrapper for linguist (published at crazymax/linguist), but I believe the official version would be a much better thing to have for the community. Some companies do not allow use of non-official docker images as they are more likely to contain unsafe code. The official image is not only trustworthy, but is also more likely to be constantly maintained.

WDYT of publishing an official image to https://hub.docker.com/_/github-linguist?

URL of the affected repository:

Any

@pchaigno
Copy link
Contributor

We could probably go for a first Ubuntu-based image and improve it (reduce its size) later if necessary. @lildude @Alhadis What do you think?

@lildude
Copy link
Member

lildude commented Aug 20, 2019

We could probably go for a first Ubuntu-based image and improve it (reduce its size) later if necessary. @lildude @Alhadis What do you think?

I suspect we can go straight for Alphine or similar as the requirements are pretty small.

My only reservation is around the publishing of a GitHub officially sanctioned and supported docker image on Docker Hub or even GitHub Package Registry (GPR).

This statement from @kachkaev is what raises this concern:

Some companies do not allow use of non-official docker images as they are more likely to contain unsafe code. The official image is not only trustworthy, but is also more likely to be constantly maintained.

This is going to need clearance from GitHub Product and an owner/supporter etc will need to be found as it may have legal implications. At the moment Linguist's "ownership" within GitHub is in flux. Having a community maintained and updated image would work but may put that requirement into question for some companies.

I have no problem starting with adding a Dockerfile though.

@stale
Copy link

stale bot commented Sep 19, 2019

This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions.

@stale stale bot added the Stale label Sep 19, 2019
@kachkaev
Copy link
Author

I have checked the code and this issue is still relevant because an official docker image is still not available

ping @lildude. would you be interested in crafting one?

@stale stale bot removed the Stale label Sep 19, 2019
@lildude
Copy link
Member

lildude commented Sep 19, 2019

ping @lildude. would you be interested in crafting one?

I assume you mean Dockerfile. I can, but I won't be able to get to it until about the middle of October at the earliest.

@lildude lildude self-assigned this Oct 3, 2019
@dzaytsev91
Copy link
Contributor

dzaytsev91 commented Oct 28, 2019

@lildude
I added Dockerfile based on ruby:alpine, please review #4687

@arkban
Copy link

arkban commented Apr 29, 2020

I stumbled on someone else making a docker image for this: https://github.com/crazy-max/docker-linguist

I'm using it without complaints, thought others might want find it useful.

@lildude
Copy link
Member

lildude commented Apr 29, 2020

@arkban that's the one mentioned in the OP 😉

Reminds me, I still need to finish looking into that.

@arkban
Copy link

arkban commented Apr 29, 2020

@arkban that's the one mentioned in the OP 😉

Apologies! Firefox find you've failed me for the 58294th time!

@lildude
Copy link
Member

lildude commented Sep 8, 2020

#4687 has ben merged. Closing.

@lildude lildude closed this as completed Sep 8, 2020
@kachkaev
Copy link
Author

kachkaev commented Sep 8, 2020

@lildude glad to see the official Dockerfile! WDYT of publishing the image on Dockerhub (https://hub.docker.com/) for ease of access? Pretty much all dockerized projects share their images this way. Until that's done, using linguist via docker in CI is still challenging – one needs to create a non-official image, publish it somewhere and only then use.

It'd be great if we could keep this issue open till that's sorted.

@lildude
Copy link
Member

lildude commented Sep 8, 2020

As I mentioned before, I'm reluctant to publish a formal image and the state of Linguist's internal ownership is still in flux so I'm not likely to get sanctioning any time soon.

I'll re-open the issue for tracking, but don't expect this image any time soon.

@lildude lildude reopened this Sep 8, 2020
@lildude lildude added the Blocked label Sep 8, 2020
@abdennour
Copy link

Guys! i can offer centralized image using my software: https://github.com/abdennour/dockerfiles
However, i prefer to maintain it here.
Our main concern is to get the image as a service.

@abdennour
Copy link

@kachkaev
Copy link
Author

kachkaev commented Nov 21, 2021

I managed to find an alternative solution to using a docker image. @Nixinova ported linguist to JavaScript, the source is here: https://github.com/Nixinova/Linguist. The npm package is called linguist-js.

So now we can run npx linguist-js on any machine that has Node.js 🎉

Please note that this is not an official port, i.e. a completely different codebase by an independent author. Project goal is the same though and the results are similar.

How about mentioning the port in README?

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

No branches or pull requests

6 participants