Topic 1 Question 22
2 つ選択One of the developers on your team deployed their application in Google Container Engine with the Dockerfile below. They report that their application deployments are taking too long.
You want to optimize this Dockerfile for faster deployment times without adversely affecting the app's functionality.
Which two actions should you take?Remove Python after running pip
Remove dependencies from requirements.txt
Use a slimmed-down base image like Alpine Linux
Use larger machine types for your Google Container Engine node pools
Copy the source after he package dependencies (Python and pip) are installed
解説
The speed of deployment can be changed by limiting the size of the uploaded app, limiting the complexity of the build necessary in the Dockerfile, if present, and by ensuring a fast and reliable internet connection. Note: Alpine Linux is built around musl libc and busybox. This makes it smaller and more resource efficient than traditional GNU/Linux distributions. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. Not only do you get a fully-fledged Linux environment but a large selection of packages from the repository. Reference: https://groups.google.com/forum/#!topic/google-appengine/hZMEkmmObDU https://www.alpinelinux.org/about/
ユーザの投票
コメント(17)
C & E: C: Smaller the base image with minimum dependency faster the container will start E: Docker image build uses caching. Docker Instructions sequence matter because application’s dependencies change less frequently than the Python code which will help to reuse the cached layer of dependency and only add new layer for code change for Python Source code.
👍 41aviratna2021/06/26C & E are the correct answers. Kindly refer - https://www.docker.com/blog/intro-guide-to-dockerfile-best-practices/
👍 6vincy22022021/11/21A -invalid B-dependencies are required C-it will help as it is one of the best practices to make use of lighter image if possible D-Not helpful E-is the best practice to do the steps that changes more frequently at the end . so copy . should be performed at last as it will be changing more frequently and we can make use of docker caching hence Answer E is most then C
👍 4belly2652022/02/19
シャッフルモード