Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ questions:
- { value: 'Use a .dockerignore file', correct: true }
- { value: 'Use the --exclude flag', correct: false }
- { value: 'Files are automatically excluded by Docker', correct: false }
help: 'https://docs.docker.com/reference/dockerfile/#dockerignore-file'
help: 'https://docs.docker.com/build/concepts/context/#dockerignore-files'

- uuid: 6c02d847-f098-49b7-8547-08dfd53ef3b1
question: Which of the following instructions is preferred for copying local files into an image when no archive extraction is needed?
Expand Down
12 changes: 6 additions & 6 deletions data/2_Image_creation_management_registry/deploy_registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ questions:
- { value: 'docker deploy registry', correct: false }
- { value: 'docker run -d -p 5000:5000 --name registry registry:2', correct: true }
- { value: 'docker image push registry:2', correct: false }
help: 'https://docs.docker.com/registry/deploying/'
help: 'https://distribution.github.io/distribution/about/deploying/'

- uuid: 1ae849c1-286f-419b-a6df-7931a5f650e5
question: Which port is exposed by default in the official Docker registry image?
Expand All @@ -15,7 +15,7 @@ questions:
- { value: '443', correct: false }
- { value: '5000', correct: true }
- { value: '80', correct: false }
help: 'https://docs.docker.com/registry/'
help: 'https://distribution.github.io/distribution/about/deploying/'

- uuid: b34b189f-1d12-452e-ae42-88c531cf9b26
question: What is the purpose of setting the environment variable `REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY` in the registry container?
Expand All @@ -24,7 +24,7 @@ questions:
- { value: 'To expose a custom port', correct: false }
- { value: 'To connect to Docker Hub', correct: false }
- { value: 'To define registry authentication', correct: false }
help: 'https://docs.docker.com/registry/configuration/'
help: 'https://distribution.github.io/distribution/about/configuration/'

- uuid: 51a93188-2a87-4fd5-b1c4-c6373ce3e57a
question: What storage backend is used by default in the official registry image?
Expand Down Expand Up @@ -60,7 +60,7 @@ questions:
- { value: 'Use the Alpine base image', correct: false }
- { value: 'Enable TLS using a valid certificate', correct: true }
- { value: 'Run in host network mode', correct: false }
help: 'https://docs.docker.com/registry/deploying/#running-a-domain-registry'
help: 'https://distribution.github.io/distribution/about/deploying/'

- uuid: 287ba12b-8638-4bcb-9fbd-34f5360a062c
question: What is the risk of exposing a registry without TLS in production?
Expand All @@ -78,7 +78,7 @@ questions:
- { value: 'docker run -v /opt/registry:/var/lib/registry registry:2', correct: true }
- { value: 'docker run --mount type=bind,target=/var/run/docker.sock registry:2', correct: false }
- { value: 'docker run --tmpfs /var/lib/registry registry:2', correct: false }
help: 'https://docs.docker.com/registry/storage-drivers/filesystem/'
help: 'https://distribution.github.io/distribution/about/deploying/'

- uuid: f5d7dc60-c003-41e3-9058-381b2b0dd5c5
question: Which configuration file allows customizing a registry with authentication, storage, and logging options?
Expand All @@ -87,4 +87,4 @@ questions:
- { value: 'daemon.json', correct: false }
- { value: 'registry.conf', correct: false }
- { value: 'config.yml', correct: true }
help: 'https://docs.docker.com/registry/configuration/'
help: 'https://distribution.github.io/distribution/about/configuration/'
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ questions:
- { value: 'The port is documented but not published to the host automatically', correct: true }
- { value: 'Docker maps it to a random host port', correct: false }
help: https://docs.docker.com/engine/reference/builder/#expose

- uuid: 3fc5d85e-d5cd-4a96-9b27-bd10a5893e14
question: What makes the ADD instruction different from COPY in Dockerfiles?
answers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ questions:
- { value: 'Because ENV variables are not supported', correct: false }
- { value: 'Because Docker blocks secret keys automatically', correct: false }
- { value: 'Because they are encrypted by default', correct: false }
help: 'https://docs.docker.com/develop/dev-best-practices/#dont-store-secrets-in-images'
help: 'https://docs.docker.com/build/building/secrets'
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ questions:
- { value: '.Tag', correct: false }
- { value: '.Name', correct: false }
- { value: '.Repository', correct: true }
help: https://docs.docker.com/reference/cli/docker/image/ls/
help: https://docs.docker.com/reference/cli/docker/image/ls/#format

- uuid: b0a18a67-7c4e-44cf-869d-393f6aa3a239
question: Which of the following would show image IDs and repositories using Go templates?
Expand All @@ -51,7 +51,7 @@ questions:
- { value: 'Custom output using Go templates', correct: true }
- { value: 'Filtering by tag', correct: false }
- { value: 'Binary output for API usage', correct: false }
help: https://docs.docker.com/reference/cli/docker/image/ls/#format-the-output---format
help: https://docs.docker.com/reference/cli/docker/image/ls/#format

- uuid: d9e7e73c-c8f3-46cc-b6c0-734a53b939fc
question: Which Go template variable shows the image’s tag?
Expand Down Expand Up @@ -101,19 +101,19 @@ questions:
- uuid: b963e979-9975-4de0-bf3b-3ac93d537029
question: What filter lists only images created before `ubuntu:20.04`?
answers:
- { value: '--filter created<ubuntu:20.04', correct: false }
- { value: '--before ubuntu:20.04', correct: false }
- { value: '--filter before=ubuntu:20.04', correct: true }
- { value: '--filter earlier=ubuntu:20.04', correct: false }
- { value: '--filter "created<ubuntu:20.04"', correct: false }
- { value: '--before "ubuntu:20.04"', correct: false }
- { value: '--filter "before=ubuntu:20.04"', correct: true }
- { value: '--filter "earlier=ubuntu:20.04"', correct: false }
help: https://docs.docker.com/reference/cli/docker/image/ls/#filter-images-by-time

- uuid: 85c92a25-fdb0-4f47-8f08-09975e05aeef
question: Which filter will select images with label `env=prod`?
answers:
- { value: '--filter label=env=prod', correct: true }
- { value: '--filter env=prod', correct: false }
- { value: '--filter "label=env=prod"', correct: true }
- { value: '--filter "env=prod"', correct: false }
- { value: '--env prod', correct: false }
- { value: '--label filter=env=prod', correct: false }
- { value: '--label "filter=env=prod"', correct: false }
help: https://docs.docker.com/reference/cli/docker/image/ls/#show-images-with-a-given-label

- uuid: 34e63460-e69c-4e71-961f-726a42a1e4e2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ questions:
- { value: 'Docker removes the image from the local cache', correct: false }
- { value: 'The image remains accessible via the other tag', correct: true }
- { value: 'All tags are removed', correct: false }
help: https://docs.docker.com/reference/cli/docker/image/tag/
help: https://docs.docker.com/reference/cli/docker/image/rm/#description

- uuid: e4cfbe38-3033-4b0e-8f2e-3f1ec1992c0e
question: Can you tag an image with a full URL including port number?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ questions:
- { value: 'registry:2 image in a docker-compose file', correct: true }
- { value: 'A config.json in ~/.docker', correct: false }
- { value: 'A YAML Compose with alpine', correct: false }
help: https://docs.docker.com/registry/deploying/
help: https://distribution.github.io/distribution/about/deploying/

- uuid: d6ebc119-9334-44e0-b49f-76a0ee29f2fa
question: What environment variable can be used to set a registry credential for non-interactive login?
Expand All @@ -78,7 +78,7 @@ questions:
- { value: 'It stores image logs', correct: false }
- { value: 'It encrypts image layers', correct: false }
- { value: 'It scopes images per user or org in the registry', correct: true }
help: https://docs.docker.com/docker-hub/repos/#repository-namespaces-and-repository-visibility
help: https://docs.docker.com/docker-hub/repos/create/

- uuid: 34719f42-0321-4d5f-b5c2-0b1d676eb3f7
question: Which of the following can be used to deploy a private registry securely?
Expand Down
12 changes: 6 additions & 6 deletions data/2_Image_creation_management_registry/display_layers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ questions:
question: Which 'docker history' option shows the cumulative size of image layers?
answers:
- { value: '--quiet', correct: false }
- { value: '--format', correct: false }
- { value: '--human', correct: true }
- { value: '--format "{{.Size}}"', correct: true }
- { value: '--human', correct: false }
- { value: '--no-trunc', correct: false }
help: https://docs.docker.com/engine/reference/commandline/history/
help: https://docs.docker.com/reference/cli/docker/image/history/

- uuid: 85dd16f7-d749-4132-9359-30c61d9bcd45
question: What is the typical output of the command 'docker history nginx'?
Expand Down Expand Up @@ -66,9 +66,9 @@ questions:
question: What is the best way to visualize the layers of an image with the exact commands used to generate them?
answers:
- { value: 'docker history --no-trunc nginx', correct: true }
- { value: 'docker ps -a', correct: false }
- { value: 'docker image inspect', correct: false }
- { value: 'docker diff', correct: false }
- { value: 'docker ps -a nginx', correct: false }
- { value: 'docker image inspect nginx', correct: false }
- { value: 'docker diff nginx', correct: false }
help: https://docs.docker.com/engine/reference/commandline/history/

- uuid: cdc2fd95-fb2b-4b6c-8352-b453327cf98e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ questions:
- { value: 'docker logout', correct: true }
- { value: 'docker disconnect', correct: false }
- { value: 'docker signout', correct: false }
help: https://docs.docker.com/reference/cli/docker/login/
help: https://docs.docker.com/reference/cli/docker/logout/

- uuid: d1cd4f6f-6f11-4a39-a215-116e1d10c4d4
question: If you omit a registry in docker login, which registry is used?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ questions:
- uuid: f4df88a0-c1f7-4c9d-bd0e-e2ad3ad66aa7
question: Can `docker rmi` delete an image that is currently being used by a running container?
answers:
- { value: 'Only if using the `--force` flag', correct: false }
- { value: 'No, you must stop and remove the container first', correct: true }
- { value: 'Only if using the `--force` flag', correct: true }
- { value: 'No, you must stop and remove the container first', correct: false }
- { value: 'Yes, but the container will crash', correct: false }
- { value: 'Yes, the image will be removed anyway', correct: false }
help: 'https://docs.docker.com/reference/cli/docker/image/rm/'
Expand All @@ -50,7 +50,7 @@ questions:
- { value: 'docker pull nginx --all', correct: false }
- { value: 'docker image pull-all nginx', correct: false }
- { value: 'docker pull --all-tags nginx', correct: true }
- { value: 'docker pull -a nginx', correct: false }
- { value: 'docker pull nginx:*', correct: false }
help: 'https://docs.docker.com/reference/cli/docker/image/pull/#options'

- uuid: 79c7dc5e-2878-4b61-9e32-9c7f7ff9694a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ questions:
- { value: 'Letters and slashes only', correct: false }
- { value: 'Only lowercase letters', correct: false }
- { value: 'a-z, 0-9, hyphen (-), underscore (_) and dot (.)', correct: true }
help: https://docs.docker.com/reference/cli/docker/image/tag/#extended-description
help: https://docs.docker.com/reference/cli/docker/image/push/#examples

- uuid: 0f93a32d-eac8-4ed6-8856-b2f5bcfc8e9b
question: What does `--disable-content-trust` do?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ questions:
- { value: 'Vault', correct: false }
- { value: 'HashiSign', correct: false }
- { value: 'Notary', correct: true }
help: https://github.com/notaryproject/notary#using-notary
help: https://docs.docker.com/engine/security/trust/#signing-images-with-docker-content-trust

- uuid: 741a8e0a-d685-464a-a678-57d571c3d2cc
question: Which keys are involved in the Docker Content Trust system?
Expand Down
4 changes: 2 additions & 2 deletions data/2_Image_creation_management_registry/single_layer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ questions:
- { value: 'docker build --squash -t myimage .', correct: true }
- { value: 'docker build --single-layer .', correct: false }
- { value: 'docker prune --layers', correct: false }
help: https://docs.docker.com/engine/reference/commandline/build/#squash-an-image
help: https://docs.docker.com/reference/cli/docker/image/build/#squash

- uuid: 8ed57f28-4734-4ed1-88b8-55e0e5c747b4
question: What is a possible consequence of using --squash?
Expand All @@ -42,7 +42,7 @@ questions:
- { value: 'To reduce the attack surface and final size', correct: true }
- { value: 'To add more system dependencies', correct: false }
- { value: 'To avoid the build cache', correct: false }
help: https://docs.docker.com/develop/develop-images/multistage-build/
help: https://docs.docker.com/build/building/best-practices/#choose-the-right-base-image

- uuid: 36f3ac3b-fde1-45e0-9e07-6a34b81db8d4
question: Is the `--squash` flag enabled by default in `docker build`?
Expand Down