0
0
Dockerdevops~10 mins

Container to container communication 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 start a Docker container named 'webapp'.

Docker
docker run --name [1] -d nginx
Drag options to blanks, or click blank then click option'
Acache
Bwebapp
Cdatabase
Dbackend
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different container name than 'webapp'.
2fill in blank
medium

Complete the Docker network creation command to allow containers to communicate.

Docker
docker network create [1]
Drag options to blanks, or click blank then click option'
Aisolated_net
Bbridge
Chost
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using default network driver names instead of a custom network name.
3fill in blank
hard

Fix the error in the command to connect a container named 'db' to the network 'isolated_net'.

Docker
docker network [1] isolated_net db
Drag options to blanks, or click blank then click option'
Aconnect
Bjoin
Cattach
Dlink
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'attach' or 'link' instead of 'connect'.
4fill in blank
hard

Fill both blanks to run two containers on the same network 'isolated_net'.

Docker
docker run -d --name webapp --network [1] nginx
docker run -d --name db --network [2] mysql
Drag options to blanks, or click blank then click option'
Aisolated_net
Bbridge
Chost
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using different networks for each container.
5fill in blank
hard

Fill all three blanks to create a Docker Compose service for 'webapp' that connects to the 'isolated_net' network.

Docker
services:
  webapp:
    image: nginx
    networks:
      - [1]
networks:
  [2]:
    driver: [3]
Drag options to blanks, or click blank then click option'
Aisolated_net
Bbridge
Chost
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'host' or 'none' as the driver.