Docker - Images - multichoice questions

Question 1

How many layers is the image sonatype/nexus3:3.41.0 composed by?

Question 2

Given the bellow directory structure for a Go app:

.
|-- app.Dockerfile
|-- cmd
|   |-- client
|   |   |-- main.go
|   |   |-- request.go
|   |   |-- ui.go
|   |-- server
|       |-- main.go
|       |-- translate.go
|-- go.mod
|-- go.sum

The app should be built with a Dockerfile named app.Dockerfile (instead the default name of Dockerfile). Which command can build the app?

Question 3

Given a linux machine with OS architecture of arm/v5. What happens when running the following command:

docker run nginx:1.24.0

Question 4

In the terminal, you are current working directory is /home/user/app and you want to build a Docker image for your application located in /home/user/app/src directory. The Dockerfile is also located in /home/user/app/src.

Which of the following command(s) will build the app?

Question 5

What is wrong in the bellow Dockerfile:

FROM python:3.10.15
WORKDIR /test
COPY ../tutorials .
RUN pip install -r requirements.txt

CMD ["python3", "app.py"]

Question 6

What happens when you run a Docker image that was packed with a Linux kernel different from the kernel of the host machine (the machine the container is running on)?

Question 7

You are told that the python docker image consists of 8 layers. You build a new image according to the following dockerfile:

FROM python
WORKDIR /test

How many layers your image will consist by?

Question 8

In a Dockerfile, suppose you have the following line: COPY app/ /usr/src/app/. Assume the owner and group of app directory on your host machine is elvis, which its UID (user id) is 1000 and GID (group id) is 1000.

What will be the UID and GID of the files in the /usr/src/app directory in the resulting Docker image?

Question 9

Your Flask app is expecting an environment variable called FLASK_APP. How can you define this variable in the build time, within your Dockerfile?

Question 10

Given an image called curl-tool built using the below Dockerfile

FROM ubuntu
LABEL description="Containerized `curl` tool image"

RUN apt update && apt install curl -y

ENTRYPOINT ["curl"]
CMD ["google.com"]

Which of the following docker run commands will be running successfully?