-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docker: add example Dockerfile #2844
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM python:3.7 | ||
|
||
# Better movement with [Ctrl + →] and [Ctrl + ←] | ||
ENV INPUTRC=/etc/inputrc | ||
|
||
RUN set -ex \ | ||
&& echo '"\e[1;5C": forward-word' >> /etc/inputrc \ | ||
&& echo '"\e[1;5D": backward-word' >> /etc/inputrc | ||
|
||
# Set working directory. | ||
# Mount your project under the same path. | ||
WORKDIR /usr/src | ||
|
||
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could be whatever you want, I've seen some Dockerfiles using |
||
# Install useful programs | ||
RUN apt-get update -y && apt-get install -y \ | ||
less \ | ||
git | ||
Comment on lines
+15
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's up with this odd formatting? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Readability, you can see at first glance what packages are being installed. |
||
|
||
# Install DVC, supporting all remotes | ||
RUN pip install "dvc[all]" | ||
|
||
# Enable autocompletion scripts for DVC | ||
RUN wget \ | ||
-O /etc/bash_completion.d/dvc \ | ||
https://github.com/raw/iterative/dvc/master/scripts/completion/dvc.bash | ||
Comment on lines
+23
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I understand why docker image needs bash completion. And if it does, why not zsh as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usability. We opted to use Bash instead of Zsh. I don't see the point of using both. |
||
|
||
# Add a user to run DVC | ||
ARG USER_ID=1000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose you are doing this so that files created by dvc are not owned by root, right? If so, now they are going to be owned by UID 1000, which is absolutely not guaranteed to match your current user on the host. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user must build the image with their UID, see the description of the issue: |
||
RUN useradd --create-home -u ${USER_ID} dvc | ||
USER dvc |
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.
Don't quite understand what this is for and why this is needed in the docker file.
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.
Usability. If you get into the shell, you won't be able to use
Ctrl + arrows
to move between words, for me it is annoying, that's why I added this.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.
again I think this is on the same level as zstyle - something that is generic shell/system-related and not about
dvc