Compose lab help - links required for docker compose version 3?

Hello,

I need help with question 5:

"Create a docker-compose.yml file under the path /root/wordpress . Once done, run a docker-compose up.

The compose file should have exact specification of the wordpress and db container"

I learned that in Docker Compose version 3 files, links are not required. In this lab, I am using a docker compose file version 3, and when I run the compose file, Docker complains that the containerized applications require links.

Here I try commenting out the links property. Here is my .yml code:

image

I thought that we do not need links with version 3 compose files, or am I missing something?

Thank you.

Basically, links is no longer needed because its main purpose, making container reachable by another by adding environment variable, is included implicitly with network . When containers are placed in the same network, they are reachable by each other using their container name and other alias as host.

I know that, but why am I having an issue with my compose file? Could you address my question above, please?

No one can provide an answer?

Hello, @synth45
Actually validation is looking for links field. That’s why checks are not passing. You can use links to pass the validation as of now.

Hi, @Tej-Singh-Rana. Okay, but I thought that version 3 of Compose files do not need link properties? Or does the declaration of Compose version have put at the top of the compose file so it can be processed first?

Thanks.