0
0
Dockerdevops~10 mins

Host networking mode in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to run a Docker container using host networking mode.

Docker
docker run --rm -it --network=[1] nginx
Drag options to blanks, or click blank then click option'
Aoverlay
Bbridge
Cnone
Dhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' instead of 'host' will isolate the container network.
2fill in blank
medium

Complete the Docker Compose service definition to use host networking mode.

Docker
services:
  web:
    image: nginx
    network_mode: [1]
Drag options to blanks, or click blank then click option'
Ahost
Bbridge
Cnone
Dcustom
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' or 'custom' instead of 'host'.
3fill in blank
hard

Fix the error in the Docker run command to enable host networking mode.

Docker
docker run --rm -it --network [1] nginx
Drag options to blanks, or click blank then click option'
Ahost_network
Bhost
Chost=
Dhost-network
Attempts:
3 left
💡 Hint
Common Mistakes
Adding '=' after 'host' or using underscores instead of hyphens.
4fill in blank
hard

Fill both blanks to create a Docker command that runs a container with host networking and removes it after exit.

Docker
docker run --rm [1] --network=[2] nginx
Drag options to blanks, or click blank then click option'
A-it
B-d
Chost
Dbridge
Attempts:
3 left
💡 Hint
Common Mistakes
Using detached mode '-d' with interactive '-it' or wrong network mode.
5fill in blank
hard

Fill all three blanks to define a Docker Compose service that uses host networking, runs detached, and restarts always.

Docker
services:
  app:
    image: nginx
    network_mode: [1]
    restart: [2]
    command: [3]
Drag options to blanks, or click blank then click option'
Ahost
Balways
Cnginx -g 'daemon off;'
Dbridge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' instead of 'host' or missing the command to keep nginx running.