-
Notifications
You must be signed in to change notification settings - Fork 68
Add Docker support. #5
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
Conversation
| MAINTAINER Tecnativa <info@tecnativa.com> | ||
| ENTRYPOINT ["/usr/src/app/entrypoint.sh"] | ||
| ENV GIT_AUTHOR_NAME=git-aggregator \ | ||
| EMAIL=https://hub.docker.com/r/tecnativa/git-aggregator |
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.
Once you set up your automated build, you'd have to refer to https://hub.docker.com/r/acsone/git-aggregator here.
|
|
||
| You can use `git-aggregator` from CLI without installing anything but Docker: | ||
|
|
||
| $ docker run -it --rm -v $(pwd):/repos tecnativa/git-aggregator -c repos.yaml |
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.
... and to acsone/git-aggregator here.
|
@yajo thanks for your interest and contribution! git-aggregator is a pure python library and CLI. There are many ways to install it and possibly isolate it from the system. docker is just one of them. virtualenv is another possibility and there are more. For instance, if you don't want to pollute your system with a global pip install, you can install it in a virtualenv and symlink the executable in your PATH, eg: So I tend to think adding docker support goes a bit beyond the scope of this project. |
|
Although virtualenv served its purpose for many years, the isolation it provides is way behind Docker's. I think the work is very little (I did most of it for you 😉) and the benefits are a lot. In fact I think adding Docker support is good in any project! A couple of files and some configuration and suddenly you have an automatically up-to-date tiny pluggable operating system that flawlessly runs your app, awesome! 😊 This enables any DevOps to plug the library into any dockerized environment by simply sharing a volume, or running in localhost by a new CLI option that he knows includes every possible dependency and handles every corner case. OTOH it's not a matter of if this is going to be dockerized or not. It is already, and will continue being. It is a matter of sharing efforts or forking them. I'm pretty sure we all believe sharing is better for everybody. |
1 similar comment
1 similar comment
1 similar comment
1 similar comment
|
Here you can see how I'm using it right now:
This is useful to deploy a fully docker-based devel env. @lasley what do you think? |
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 agree that Dockerization is something that benefits all projects greatly. I am definitely more likely to test a project out if it is pre-Dockerized vs setting up an environment manually.
The argument could be made that a pip install is pretty easy too. I counter this with the fact that a virtual env setup, activation, pip install, then subsequent deactivation & deletion is a 5-6 step process - not even considering if some sort of development headers are required. My workstations are Mac, so I find myself butting against the dev headers pretty often due to my refusal to install something like homebrew due to the mess it makes of the filesystem.
To contrast this, testing something in Docker is always a 1 step process & that process is always the same. This allows me to skip all installation steps for a repo & go directly to using it. I find this incredibly beneficial when searching for a lib/app to base mine from. Additionally- I absolutely despise reading manuals, so yeah definitely a big win IMO.
| MAINTAINER Tecnativa <info@tecnativa.com> | ||
| ENTRYPOINT ["/usr/src/app/entrypoint.sh"] | ||
| ENV GIT_AUTHOR_NAME=git-aggregator \ | ||
| EMAIL=https://hub.docker.com/r/tecnativa/git-aggregator |
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.
Tecnativa repo?
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.
This is because this code builds https://hub.docker.com/r/tecnativa/git-aggregator/, and I don't want to address people to Acsone until they acknowledge maintenance of this image (in which case it would become https://hub.docker.com/r/acsone/git-aggregator/ or something similar). That's why I said what I said in #5 (comment).
| EMAIL=https://hub.docker.com/r/tecnativa/git-aggregator | ||
| # HACK Install git >= 2.11, to have --shallow-since | ||
| # TODO Remove HACK when python:alpine is alpine >= v3.5 | ||
| RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/main git |
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.
@yajo Hrmmmm so remember when I reported that this didn't work in the Odoo Docker container? Well it works here.
I took it a step further and created a dockerfile with just this in it, and it still worked. My curiosity is peaked, so I'll probably fool around with this a bit more in that context.
| if [ $uid -ne $(id -u root) ]; then | ||
| gid=$(stat -c %g /repos) | ||
| addgroup -g $gid threpwood | ||
| adduser -G threpwood -u $uid guybrush -DH -s /bin/sh |
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.
threpwood & guybrush - Intentional?
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.
Absolutely 😆
All that matters is the UID & GID, so I had to put some name and that one came to my mind ☠️
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.
Curious, mainly due to my newness in Docker arena- if you use a user that exists on the host system, are the GID and UID matched with the system user/group of the same name?
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.
Yes, that's why this hack, it allows you to use the docker app and let it use your same user permissions. So after cloning, no root-owned files are there.
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.
Awesome thanks for the elaboration! I've been running into permissions issues lately & I have no idea why this never dawned on me 😄
|
After further thinking we consider maintaining a docker image is out of scope of this project. People willing to maintain a docker image of git-aggregator are welcome to do so of course. That does not require a fork of this project. @yajo I see here you install it as part of a larger image so I guess this is less important for you now. |
|
Indeed, thanks anyway 😉 |
Hi friends, I found this to be very useful.
We'd love to be able to use this tool in docker environments, or simply in localhost without having to blur local system with pip installs somewhere.
This simple patch adds support for it. Of course, besides merging this, you'd have to create an automated build in your Docker Hub, and then replace lines referring to
tecnativa/git-aggregatorimage with the brand newacsone/git-aggregatorone. I can help you in the process if you want.@Tecnativa