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? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Use a slimmed-down base image like Alpine Linux, Copy the source after he package dependencies (Python and pip) are installed.
Why this is the answer
Using a slimmed-down base image like Alpine Linux significantly reduces image size, leading to faster download times and quicker deployments. Copying the source code after installing dependencies leverages Docker's layer caching. If only the source code changes, Docker can reuse the cached layer for dependency installation, avoiding redundant downloads and builds of dependencies, which saves considerable time during subsequent deployments. Removing Python after running pip would break the application if it's a Python application, as Python is needed at runtime. Removing dependencies from requirements.txt would likely break the application. Using larger machine types for node pools would not directly speed up Docker image build or deployment times; it would only provide more resources for running the containers once deployed.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed