Created
December 13, 2019 23:02
-
-
Save blackrobot/c313ed427c8995df5de3b3b1993632f4 to your computer and use it in GitHub Desktop.
Code for https://stackoverflow.com/questions/59330123/bulding-docker-image-for-several-script answer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" cano.py """ | |
if __name__ == "__main__": | |
print("Hello world! (from cano.py)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7 | |
# Install the dependencies for R | |
RUN apt-get update && apt-get install -y r-base r-base-dev r-recommended | |
# Add all of the scripts to the /opt/app/ path inside of the image | |
ADD . /opt/app/ | |
# Change the working directory inside of the image to /opt/app/ | |
WORKDIR /opt/app/ | |
# Install the python dependencies in /opt/app/requirements.txt using pip | |
RUN pip3.7 install -r ./requirements.txt | |
# This command just shows info about the contents of the image. It doesn't run any | |
# scripts, since that will be done _AFTER_ the image is built. | |
CMD pwd && ls -AlhF ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My first program in R Programming | |
message <- "Hello world! (from myscript.r)" | |
print(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" qc.py """ | |
if __name__ == "__main__": | |
print("Hello world! (from qc.py)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is just an example to show the installing of pip requirements | |
requests ~= 2.22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment