-
Notifications
You must be signed in to change notification settings - Fork 263
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
Improve Docker build #239
Improve Docker build #239
Conversation
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 don't know much about docker, but the deletion of this seems that would break existing users:
COPYBARA_CONFIG=copy.bara.sky`
- allows you to specify a path to a config file, defaults to root
copy.bara.sky
COPYBARA_SUBCOMMAND=migrate
- allows you to change the command run, defaults to
migrate
- allows you to change the command run, defaults to
COPYBARA_OPTIONS=''
- allows you to specify options for copybara, defaults to none
COPYBARA_WORKFLOW=default
- allows you to specify the workflow to run, defaults to
default
- allows you to specify the workflow to run, defaults to
COPYBARA_SOURCEREF=''
If you want to handle environment arguments, this should definitely done by the executable itself. Adding this as a script to the container, feels like a big hack. Nevertheless, I added that functionality back to not break existing users for the time being. |
@mikelalcon PTAL |
COPY --from=build /tmp/copybara/ /opt/copybara/ | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* |
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.
Add comment on why remove.
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.
IIUC this is the equivalent to "apt-get clean". Any reason for using this instead?
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 suggested as best practice from Docker itself: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get
This is basically what is used in more than 99% of all Dockerfile
s. Should I still add a comment?
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, at least in the commit description. Can you: squash all changes in one and add a commit description that explains all we are doing here?
Thanks!
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.
Done
ea3a306
to
582a1bf
Compare
This allows passing args to Copybara directly via CMD as an alternative to using environment variables.
Fixes #158
Fixes #235