Step 1: Create a Python Flask image for your development projects

The goal for Step 1: Create a Python Flask image for your development projects.

We’ll continue where you left off from Step 5.3. Building a hello world python image by using the same Dockerfile.

  1. Copy your hello-world-python folder (that contains the Dockerfile) to folder flask-dev-image.

    Note

    You will use this image for labs 6 and 7

    cd ~
    cp -r hello-world-python flask-dev-image
    
  2. Navigate to flask-dev-image and build a new image for your Flask projects called python/flask:dev.

    Note

    Make changes to the Dockerfile in this folder for all Flask projects

    cd ~/flask-dev-image
    docker build -t python/flask:dev .
    
  3. Verify that image was built successfully.

    Step 7/7 : CMD python ./index.py
     ---> Running in 755548d69592
    Removing intermediate container 755548d69592
     ---> df7d7ef24f24
    Successfully built df7d7ef24f24
    Successfully tagged python/flask:dev
    sysadmin@test2:~/flask-dev-image$
    sysadmin@test2:~/flask-dev-image$ docker images
    REPOSITORY            TAG       IMAGE ID       CREATED              SIZE
    python/flask          dev       df7d7ef24f24   About a minute ago   63MB