Google Cloud Professional Cloud Developer — Question 205
You need to migrate a standalone Java application running in an on-premises Linux virtual machine (VM) to Google Cloud in a cost-effective manner. You decide not to take the lift-and-shift approach, and instead you plan to modernize the application by converting it to a container. How should you accomplish this task?
Answer options
- A. Use Migrate for Anthos to migrate the VM to your Google Kubernetes Engine (GKE) cluster as a container.
- B. Export the VM as a raw disk and import it as an image. Create a Compute Engine instance from the Imported image.
- C. Use Migrate for Compute Engine to migrate the VM to a Compute Engine instance, and use Cloud Build to convert it to a container.
- D. Use Jib to build a Docker image from your source code, and upload it to Artifact Registry. Deploy the application in a GKE cluster, and test the application.
Correct answer: D
Explanation
The correct answer is D because Jib is specifically designed to build Docker images from Java applications easily, allowing for a smooth transition to containerization. Options A and C suggest migrating the VM without directly modernizing the application into a container, while option B does not involve containerization at all, making them less suitable for this scenario.