From the course: Docker for Data Engineers
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Building an image that runs a setup script - Docker Tutorial
From the course: Docker for Data Engineers
Building an image that runs a setup script
In this demo, we'll build a slightly more meaningful Python Flask application. This Flask application will read the contents of a CSV file that we bundle up with our container and display a sample of the data in the file and the statistical summary of the files data in the app. The app will display these details to screen in a plain text tabular representation. Now, this is a Flask app as before. Now, the contents of the file that we want the app to read in is passed in as an input argument on the command line when we run the Flask app. And these contents are available in sys.argv and we access those line 11. Within the home function, that is, at the /route, that is, the main path of the app, we read in the contents of this CSV file on line 18. These contents are stored in a pandas DataFrame, df. On line 21, we access the first 30 records of the file's contents and store that in a variable, data_csv. We run describe on the DataFrame and get a statistical summary of the data and store…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Building your first Docker image5m 46s
-
(Locked)
Overriding the CMD instruction1m 52s
-
(Locked)
Using the Python base image5m 18s
-
(Locked)
Running a container in interactive mode2m 29s
-
(Locked)
Specifying the Dockerfile to run a Python application6m 36s
-
(Locked)
Running the containerized Python application5m 7s
-
(Locked)
Running multiple containers from the same image3m 28s
-
(Locked)
Building an image that runs a setup script6m 14s
-
(Locked)
Overriding the ENTRYPOINT directive4m 38s
-
(Locked)
-
-
-