Solutions to Exercises
Exercise 1
- Exercise: Create a docker image for simple flask application
- Steps:
git clone https://github.com/Sysnove/flask-hello-world.git
cd flask-hello-world
mv hello.py app.py
pip3 install flask
flask run -h "0.0.0.0"
- Refer Here for the dockerfile
- In alpine image git was not installed so moving to bullseye Refer Here
- Build the image and run the container
- Now lets inspect the sizes of images
- To fix the size issue, we have moved to bulls eye only for git
- One solution is to use the multistage build and copy the directory
- Second solution is clone the git while building the image
- Second solution can be found at Refer Here
Exercise -2
- Refer Here for the manual steps to install nop commerce
- Solution:
- Take an asp.net core runtime
- Add unzip installation
- unzip the nopcommerce
- run the application by
dotnet Nop.Web.dll - Take
mcr.microsoft.com/dotnet/aspnet:6.0as base image.
- Start building the image.
- Refer Here for the docker file
