A Dockerfile specifies how to build a single Docker image; Docker Compose specifies how to run multiple containers in combination. I would say that learning how to write your own Dockerfile and use docker build is pretty essential; Compose is useful, but it’s also not the only way to run things, and it does have its limitations.
If your docker-compose.yml file has a block that says build: some_directory, then running docker-compose build will run some_directory/Dockerfile to build the image.