Assuming you have installed docker desktop and added docker extension in visual studio code.
First, You add docker files to the workspace by pressing Ctrl+Shift+P and selecting add docker files to workspace. Then you get dockerfile and docker-compose files.
Then, you can build your images by pressing Ctrl+Shift+P and selecting build image. I have generate my image in the same process with a size of 191 MB.
You can also build image with the following command.
docker build -t imagename