-
-
Notifications
You must be signed in to change notification settings - Fork 37
Add docker image #81
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
base: master
Are you sure you want to change the base?
Add docker image #81
Changes from 2 commits
435eb16
5f766b9
a163d75
b32a8fb
00b6247
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,17 @@ | ||
| FROM python:3.7 | ||
|
|
||
|
Owner
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. Try to get familiar with
Author
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've used hadolint to format the Dockerfile accordingly :) |
||
| RUN apt-get update | ||
|
|
||
| RUN apt-get install -y cmake | ||
|
|
||
| RUN apt-get install -y git | ||
|
|
||
| RUN git clone https://github.com/neomatrix369/nlp_profiler.git | ||
|
||
|
|
||
| WORKDIR nlp_profiler | ||
|
|
||
| RUN pip install -r requirements-dev.txt | ||
|
|
||
| RUN pip install -r requirements.txt | ||
|
|
||
| RUN pip install -r requirements-nix-dev.txt | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/bin/bash | ||
|
Owner
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. Try to get familiar with a bash shell linter to see what comments it has about your shell script - search for Use the comments from |
||
|
|
||
| set -e | ||
| set -u | ||
| set -o pipefail | ||
|
|
||
| MOUNT_VOLUME="${PWD}/../" | ||
| TARGET_FOLDER="/nlp_profiler" | ||
| DOCKER_IMAGE_NAME="nlp_profiler" | ||
|
|
||
| echo "~~~ Running nlp_profiler in a docker container" | ||
| echo "Mounted volume: ${MOUNT_VOLUME}" | ||
|
|
||
|
Owner
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. Its a good practise to |
||
| docker build -t ${DOCKER_IMAGE_NAME} . | ||
|
|
||
|
Owner
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's a good practice to show this line executing with all its parameters, how would you do that in bash? Also look at one of the examples from the resources shared above |
||
| docker run -it \ | ||
| --volume ${MOUNT_VOLUME}:${TARGET_FOLDER} \ | ||
| --workdir ${TARGET_FOLDER} \ | ||
| ${DOCKER_IMAGE_NAME} \ | ||
| /bin/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.
See if you can make this python version configurable that you can pass it via the shell script or environment variable.
If you look into the docker shell scripts in any of these examples here, you can see how it's done.
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.
Thank you for pointing this out. I've updated the Dockerfile to pass the argument via the shell script.