-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
chore: Distribute as docker image #1875
base: main
Are you sure you want to change the base?
Conversation
bfbd9c8
to
7ee6ad0
Compare
7ee6ad0
to
1795ad5
Compare
What do you think about this implementation? I moved to using I also added some documentation about the changes, though I decided to keep it rather minimal. Not sure about the I also modified the goreleaser to only push to GHCR (initially it was configured to push to docker.io as well). P.S. Ignore the devcontainer file, that was only for my local testing. I will drop that commit once this PR is ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably also add additional tags for latest
, 3
, 3.40
etc.
.goreleaser.yml
Outdated
use: buildx | ||
dockerfile: Dockerfile | ||
extra_files: | ||
- completion/bash/task.bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct usage of these files is deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh damn, I completely missed that. Will fix!
FWIW, they still seem to be referenced throughout the goreleaser
config. If I understand correctly, the brew installer also uses them as well as the nfpms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah unfortunately, they are still used in a few places. This is why we deprecated them instead of removing them. We need to slowly remove the references to them. We could probably still add completions to the image by writing a .bashrc
during the build and using the new method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about generating the completions in the container, but then I decided against it.
It doesn't make much sense to generate the bash completions given the image is based on scratch IMHO, and even then, if we generate and include one set of completions we might as well generate all.
I think that, given the completions can be generated from the binary, it is just as simple to add a RUN
command in your dockerfile to set up your required completions.
There are already instructions for generating the completions so that should have it covered. At the end of the day, the container image is a means to distribute the binary, right?
Let me know what you think!
c05b218
to
4ca75d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't attempted to build it yet, but added some comments for now.
Co-authored-by: Andrey Nering <[email protected]>
Co-authored-by: Andrey Nering <[email protected]>
This is currently a WIP to solve #1801
Some notes
I chose debian as a base for the docker image instead of alpine, for example, such that I can load the bash completion
I set the workdir to
/workspace
to facilitate mounting volumes into the container via ad-hoc docker commands, i.e.:I set the cmd instead of the entrypoint to the
task
executable such that it is easier to just exec into the container like so:docker run -it -v $PWD:/workspace ghcr.io/go-task/task:v3.39.2-amd64 /bin/bash
the current implementation pushes both to dockerhub and ghcr.io
the current implementation pushes:
ghcr.io/go-task/task:v3.39.2
)ghcr.io/go-task/task:v3.39.2-amd64
)ghcr.io/go-task/task:latest
)TODO