docker

Migrating Docker Compose encounters yaml structure errors

I was recently migrating servers and ran into a problem. The docker-compose.yml file, which I had been using, encountered an exception after migrating to the new server. yaml: unmarshal errors: line 155: mapping key "<<" already defined at line 154 line 192: mapping key "<<" already defined at line 191 The docker-compose.yml file looks like this: version: "3.8" x-proxy: &default-proxy environment: http_proxy: http://clash:10808 https_proxy: http://clash:10808 depends_on: - clash networks: - proxy x-timesync: &time volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro nginx: <<: *default-proxy <<: *time This is a configuration for nginx that inserts two configurations, proxy and timezone.