Hello, while using lab provided with docker images I came across couple of doubts. I am listing the same below:
How to find the base OS of python 3.6 image?
From the list of images on docker host, how to check which image was downloaded most recently?
In order to create a new docker image is it must to write the steps in a file named as ‘Dockerfile’ or we can name it something else and still build an image out of it?
I was trying to build an image using the steps explained in demo lecture. I created a similar docker file but the image is not building up. The docker file looks like:
=====
$ cat Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python python3-pip
RUN pip install flask
COPY app.py /opt/app.py
ENTRYPOINT FLASK_APP=app.py flask run --host=0.0.0.0
The error that I am seeing when trying to build this:
Hello @goel.anshul949,
1- Run docker run python:3.6 cat /etc/*release* command. to check what’s the os of this image.
2- Try this docker images -a ‘–format={{.ID}} {{.CreatedAt}}’ | head -n 5
3- you can name it something else but in this case when you build the image you need to add this flag -f
4- try to use python:3.6 as a base image
I also have similar issue on this lab. I am able to build an image however I had to update my command to “RUN apt-get update && apt-get install -y python3 python3-pip”. When I try to run a container and access the flask webserver on AWS Cloud9 env, I am getting HTTP 500 error. Appreciate if you can help.