I am setting up a Python application to run a docker container (sample code below). I have a test.csv
file, and I understand I need to copy it along with the source code, as my Python script won't be able to read the file outside the container. Or is there a way to mount my local drive/folder to the container, without having to copy the data?
I am building the image via => docker build -t my-app:1.0
. Do I need to create immutable tags? If so can anyone point me to where I can find how to create it?
Once I build the container, how can I copy this container say to a dev machine? Do I need to push it to say Docker hub, and then pull this onto a different machine or can I simply copy this image onto a different machine manually?
FROM ubuntu
FROM python:2.7
# Setting Home Directory for containers
WORKDIR /app
# Installing python dependencies
COPY main.py /app/
COPY test.csv test.csv /app/
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Run the application
CMD ["python", "main.py"]