Packaging a Python Application with Docker Initially the Python App runned with Flask on a loacalhost deployment.
→ sudo apt install docker.io
Open Gedit and create the file 'dockerfile' The Docker file should contain what follows: LABEL maintainer="Chris Elobo" COPY . /app WORKDIR /app RUN pip3 install -r requirements.txt CMD [ "python", "app.py" ]
→ sudo docker build -t dockerfile .
NB: "docker build" requires exactly 1 argument (.) from current directory
→ sudo docker run d -p 5111:5000 dockerfile → sudo docker logs “generatedlogs”
→ sudo docker tag dockerfile myfirstdockerapppackaging/python-helloworld:v1.0.0
→ sudo docker login --username=christones Password:********** /* logging into my dockerhub account, where the repo myfirstdockerapppackaging was created */
→ sudo docker push myfirstdockerapppackaging/python-helloworld:v1.0.0