Dan Fletcher
Quiz von , erstellt am more than 1 year ago

Dev/Ops Quiz am Docker, erstellt von Dan Fletcher am 07/03/2019.

3078
0
0
Dan Fletcher
Erstellt von Dan Fletcher vor mehr als 5 Jahre
Schließen

Docker

Frage 1 von 24

1

What is Docker? Select the BEST explanation.

Wähle eine der folgenden:

  • Docker is software that enables applications to be bundled into a single package including all its dependencies, configuration and even the OS the application needs to run on. This makes applications highly portable and easy to scale horizontially.

  • Docker is software that enables developers to easily spin up and tear down light-weight virtual machines called "containers". Since these VM's include everything the application needs to run, it makes the app highly portable and easy to scale horizontally.

  • Docker is software that enables applications to be bundled into a single package including all its dependencies, configuration and even the OS the application needs to run on. A caveat of this is that the container requires Docker to run, so this reduces portability.

  • Docker is a container orchestration platform that aims to make the lives of dev/ops engineers easier when scaling distributed systems.

Erklärung

Frage 2 von 24

1

A container is a type of virtual machine.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 3 von 24

1

A Docker container only stays alive for as long as there is a running process.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 4 von 24

1

Which commands can be used to echo the words "Hello, world!" to the console through an Ubuntu Docker container? Select all that apply.

Wähle eine oder mehr der folgenden:

  • docker run -it ubuntu echo "Hello, world!"

  • docker run -i ubuntu echo "Hello, world!"

  • docker exec -it ubuntu echo "Hello, world!"

  • docker exec -i ubuntu echo "Hello, world!"

  • docker run ubuntu echo "Hello, world!"

Erklärung

Frage 5 von 24

1

The following command will fail without first pulling the image: `docker run ubuntu echo "Hello, world!"`

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 6 von 24

1

Fülle die Lücke, um den Text zu vervollständigen

If you have a running container named "checker" you can see the logs of that container with `docker checker`

Erklärung

Frage 7 von 24

1

A Docker container's PID is namespaced to the container itself. This means PID:1 in container A is not the same as PID:1 in container B. Furthermore, the PIDs of A and B can't be seen from the host OS nor can the containers list PID belonging to the host.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 8 von 24

1

Fülle die Lücke, um den Text zu vervollständigen

A Docker container can have its PID's namespaced the host OS by adding the option when running the container.

Erklärung

Frage 9 von 24

1

Which flag allows one Docker container to talk to the other?

Wähle eine der folgenden:

  • A Canadian flag.

  • --link <container_name>

  • --ref <container_name>

  • --join <container_name>

  • --pid <container_name>

Erklärung

Frage 10 von 24

1

Why is a Docker container lighter in terms of resources compared to virtual machine?

Wähle eine der folgenden:

  • Docker only needs to create one small virtual machine on which multiple containers can be built using much less resources than creating multiple VM's. This is possible because Docker containers are capable of sharing the same Kernel whereas VM's require the entire OS.

  • Docker containers are light weight because they usually are intended run only one thing. This means they usually have far fewer process than a virtual machine which tends to have a heavier workload and thus are usually associated with the cost of higher resource usage.

  • It's a trick question. Docker containers are not necessarily any lighter on system resources than a virtual machine. The benefit of Docker isn't that containers are lighter than VM's it's just that they can be created more easily, which is what makes them so portable.

Erklärung

Frage 11 von 24

1

Fülle die Lücke, um den Text zu vervollständigen

You can list running containers using the command:

Erklärung

Frage 12 von 24

1

Fülle die Lücke, um den Text zu vervollständigen

You can list downloaded Docker images using the command:

Erklärung

Frage 13 von 24

1

Fülle die Lücke, um den Text zu vervollständigen

You can save the CID of a newly created container by running the command: docker create /tmp/mycontainer.cid busybox

Erklärung

Frage 14 von 24

1

Explain the difference between using `docker run busybox` and `docker create busybox`

Wähle eine der folgenden:

  • The `run` command is an alias to the pull and create commands. `create` won't work if you haven't pulled the image of the container you're trying to run first.

  • The `run` command creates the container if it doesn't exist already and then runs it. `create` is used to create a new container without running it right away.

  • `create` is not a Docker command.

Erklärung

Frage 15 von 24

1

Fülle die Lücke, um den Text zu vervollständigen

Lets create a WordPress container with a read-only filesystem:

docker run -d --name wpress wordpress

Erklärung

Frage 16 von 24

1

Any given Docker container can be in one of four states. These states are named:

Wähle eine oder mehr der folgenden:

  • running

  • paused

  • restarting

  • exited

  • booted

  • down

  • suspended

  • up

  • pending

  • shutdown

Erklärung

Frage 17 von 24

1

The `--restart` option can be added at creation time to instruct Docker to restart the container. It has one of the four following:
- Do not restart at all (the default behaviour): ``
- Try to restart when a failure happens: ``
- Always restart but not when the daemon starts if it was previously put to the stopped state: ``
- Always restart when the container is down: ``

Klicke und ziehe, um den Text zu vervollständigen.

    --restart no
    --restart on-failure[:max-retries]
    --restart unless-stopped
    --restart always
    --restart off
    --restart none
    --no-restart
    --restart on-fail[:max-retries]
    --restart on-failure[:max-attempts]
    --restart only-if-stopped
    --restart on-daemon-stopped
    --restart yes
    --restart on

Erklärung

Frage 18 von 24

1

If a Docker container was created with `--restart always` and took 1 second to restart the first time it failed, how long will Docker wait before attempts restarting the container after the second time it fails?

Wähle eine der folgenden:

  • 1 second

  • 2 seconds

  • It depends on what was set with the `time-between-retries` option

  • Instantly.

Erklärung

Frage 19 von 24

1

Docker Hub is the only Docker registry available for finding Docker images.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 20 von 24

1

We want to pull a WordPress image down from the quay.io repository. Which choice accomplishes this?

Wähle eine der folgenden:

  • Run the following:
    docker remote add quay.io
    docker use quay.io
    docker pull nitros/wordpress

  • docker pull quay.io/nitros/wordpress

  • Both options will do the same thing.

  • Both options work but the `docker pull quay.io/nitros/wordpress` command will reset the remote back to Docker Hub after it pulls the image.

Erklärung

Frage 21 von 24

1

One advantage of Docker is that when you download an image it's only one file which is why it's usually so fast to download new images.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 22 von 24

1

Internally Docker uses a union filesystem. One disadvantage of this is that you don't have support for extended file attributes. To get around this limitation you can use Docker Volumes.

Wähle eins der folgenden:

  • WAHR
  • FALSCH

Erklärung

Frage 23 von 24

1

What is the reason for using Volumes in Docker?

Wähle eine der folgenden:

  • To create exceptions to the `--read-only` mode.

  • All of the above.

  • To add support for extended file attributes.

  • To sync source code on the host OS with the container so modifications to code don't require a container rebuild.

  • To gain access to persisted data such as data in a database.

Erklärung

Frage 24 von 24

1

Fülle die Lücke, um den Text zu vervollständigen

Given a directory on your host OS at `/share` and a Docker container with a directory called `/app`, how would you run the container with a volume mount between `/share` and `/app` AND have it run with read-only enabled for the volume?

Like this: `docker run -it `

Erklärung