Solution

 1# 1: edit pi.py to include new code
 2# 2: edit Dockerfile to include CMD instruction
 3# 3: follow the steps below
 4
 5$ docker build -t username/pi-estimator:0.2 .
 6$ docker run --rm username/pi-estimator:0.2
 7usage: pi.py [-h] number
 8
 9positional arguments:
10  number      number of random points (int)
11
12optional arguments:
13  -h, --help  show this help message and exit
14
15$ docker run --rm username/pi-estimator:0.2 pi.py 1000000
16Final pi estimate from 1000000 attempts = 3.143672
17
18$ docker run --rm -it username/pi-estimator:0.2 /bin/bash
19root@c5aa145e5546:/# which pi.py
20/code/pi.py
21root@c5aa145e5546:/# pi.py 1000000
22Final pi estimate from 1000000 attempts = 3.141168
23root@c5aa145e5546:/# exit
24
25$ docker push username/pi-estimator:0.2