fix: revise docker image dependencies
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
Description
This MR does the following:
- Revises the project
Dockerfile
to only include dependencies that are required to run glab functions.- git (for all of the git interactions)
- nano (the default editor in glab for writing MR bodies and other large text things)
- openssh (required for cloning repositories)
- Rewrites the entrypoint.sh (now docker-entrypoint.sh) script to remove unnecessary github/docker logins and simplify start logic.
- Borrows from nodejs' docker-entrypoint, passes glab arguments (and the glab command) directly to the glab executable
- Allows calling other commands (as one would in a ci pipeline) to work without having to manually override entrypoint.
- Updates the underlying commands for
make rt
andmake rtdebug
to work correctly with the latest version of goreleaser.- At some point it looks like the syntax these are using got deprecated/removed.
- In order to test these changes and build a docker image with
make rt
I needed to update the underlying commands.
- Renames snapshot.name_template to snapshot.version_template in
.goreleaser.yaml
-- The build (and in the existing CI builds) seemed very angry this deprecation, so I figured I'd update it while I'm in that file. Happy to revert if too far out of scope.
Related Issues
Resolves #7646 (closed)
How has this been tested?
-
go
,make
,goreleaser
installed. - A local docker image built using
make rt
. - Access-token generated and added to config.yml
- An alias added locally to use the built docker container as an ad-hoc command-- see issue #7646 (closed) for example.
- Manual testing of all the glab commands I could find to ensure that no missing dependencies were encountered.
-
glab repo clone
/glab mr create
of specific importance to test ssh and nano dependencies. - git api calls in general to ensure curl removal didn't affect those.
-
Potential issue: Open in Browser
Calls with --web
to open something in a browser don't quite work as expected in docker.
Without the BROWSER
environment variable/config set, the default appears to be to use xgd-open
, which attempts to dig for a default browser.
To keep the alpine container small, I tried both lynx
and elinks
for small, text-only browsers, however neither worked (read: didn't open at all) when glab attempted to open them. I could open up either and navigate to the gitlab link directly while inside the container, so I'm not sure if it's an issue with the browsers or some interaction with how glab is attempting to open them.
BROWSER
is available and xgd-open exits in failure, just show the url and be done with it? However this is more of a minor annoyance. The URL is still shown and is clickable from the console, even if the browser open functionality doesn't work.
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Merge request reports
Activity
Thanks for your contribution to GitLab @tzfx1!
Did you know about our community forks? Working from there will make your contribution process easier. Please check it out!
- If you need help, page a coach by clicking here or come say hi on Discord.
- When you're ready, request a review by clicking here.
- We welcome AI-generated contributions! Read more/check the box at the top of the merge request description.
This message was generated automatically. You're welcome to improve it.
added 1st contribution Community contribution workflowin dev labels
assigned to @tzfx1
added linked-issue label
mentioned in issue gitlab-org/quality/triage-reports#19550 (closed)
added groupcode review typebug labels
added devopscreate sectiondev labels
@gitlab-bot ready
Posted via contributors.gitlab.com.
added workflowready for review label and removed workflowin dev label
Hi Coach @jannik_lehmann, this Community contribution is ready for review or needs your coaching.
- Do you have capacity and domain expertise to review this? If not, find one or more reviewers and assign to them.
- If you've reviewed it, add the workflowin dev label if these changes need more work before the next review.
This message was generated automatically. You're welcome to improve it.
requested review from @jannik_lehmann
- Resolved by Oscar Tovar
@garyh Can you help reviewing this Community contribution? Thank you!
requested review from @garyh
removed review request for @jannik_lehmann
Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not automatically notify them for you.
Reviewer Maintainer @ck3g
(UTC+2)
@hacks4oats
(UTC-4)
Generated by
Dangerrequested review from @ck3g
requested review from @hacks4oats
- Resolved by A. Stadler
- Resolved by A. Stadler
- Resolved by A. Stadler
- Resolved by A. Stadler
- Resolved by Oscar Tovar
- Resolved by A. Stadler
Thanks for the contribution, it's greatly appreciated
There's a few changes being made in this MR that are not related to the removal of the image dependencies. I tried my best to annotate them with my interpretation, but if I made a mistake, please feel free to correct them. I left some suggestions to further trim down the Dockerfile to the bare minimum. Please take a look, and let me know what you think.
requested review from @hacks4oats
Awesome work on this @tzfx1 I'm approving and setting to auto merge!
started a merge train
mentioned in commit b367216e
@tzfx1, how was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:
- React with a
or a on this comment to describe your experience. - Create a new comment starting with
@gitlab-bot feedback
below, and leave any additional feedback you have for us in the comment.
Subscribe to the GitLab Community Newsletter for contributor-focused content and opportunities to level up.
Thanks for your help!
This message was generated automatically. You're welcome to improve it.
- React with a
@tzfx1, congratulations for getting your first MR merged
If this is your first MR against a GitLab project, we'd like to invite and encourage you to self-nominate yourself for
First MR Merged
swag prize here.Thank you again for contributing, what's your next contribution going to be?
This message was generated automatically. You're welcome to improve it.