Created
April 26, 2019 20:29
-
-
Save kstrauss/4c6ee9511a60f1b3ea33945df231effd to your computer and use it in GitHub Desktop.
python example dockerfile for linux
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 alpine:latest as base | |
from python:3.7.3-alpine as base | |
from base as builder | |
RUN apk add --no-cache python3 python3-dev py-pip build-base | |
# create directory to copy files to | |
RUN mkdir /install/ | |
WORKDIR /install | |
# copy the files that should have come from git | |
copy requirements.txt requirements.txt | |
# go ahead and install the python modules that also came from git | |
RUN pip install --install-option="--prefix=/install" -r requirements.txt | |
FROM base | |
copy --from=builder /install /usr/local | |
RUN mkdir /app/ | |
COPY numpyTest.py /app/numpyTest.py | |
# create a simple python script | |
#RUN echo print("Hello World from python from a container!") > c:\hello.py | |
# establish what command will run when the docker run command is executed | |
CMD ["python", "/app/numpyTest.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
import numpy as np | |
print ("start") | |
a = np.arange(15).reshape(3,5) | |
print (a) | |
print ("Done") | |
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
numpy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment