0
0
Nginxdevops~10 mins

Container networking in Nginx - 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 an nginx container exposing port 80.

Nginx
docker run -d -p [1]:80 nginx
Drag options to blanks, or click blank then click option'
A22
B443
C8080
D80
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 443 which is for HTTPS, not HTTP by default.
Using port 22 which is for SSH, unrelated to nginx.
2fill in blank
medium

Complete the docker network command to create a user-defined bridge network named 'webnet'.

Nginx
docker network create [1]
Drag options to blanks, or click blank then click option'
Awebnet
Bnone
Chost
Dbridge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bridge' which is a driver, not a network name.
Using 'host' or 'none' which are special network modes, not names.
3fill in blank
hard

Fix the error in the command to connect a container named 'web1' to the 'webnet' network.

Nginx
docker network [1] webnet web1
Drag options to blanks, or click blank then click option'
Aattach
Blink
Cconnect
Djoin
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'attach' which is for attaching to container's console.
Using 'join' which is not a docker network command.
Using 'link' which is deprecated and limited.
4fill in blank
hard

Fill both blanks to create a docker network with the bridge driver named 'mynet'.

Nginx
docker network create --driver [1] [2]
Drag options to blanks, or click blank then click option'
Abridge
Bhost
Cmynet
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'host' or 'none' as driver when bridge is needed.
Using driver name as network name or vice versa.
5fill in blank
hard

Fill all three blanks to run an nginx container named 'webapp' connected to 'mynet' network and expose port 8080 on host.

Nginx
docker run -d --name [1] --network [2] -p [3]:80 nginx
Drag options to blanks, or click blank then click option'
Awebapp
Bmynet
C8080
Dnginx
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to specify the network.
Mapping wrong ports or missing port mapping.
Using container image name as container name.