Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 10 has invalid YAML syntax #71

Open
Nnemr opened this issue Oct 30, 2024 · 1 comment
Open

Chapter 10 has invalid YAML syntax #71

Nnemr opened this issue Oct 30, 2024 · 1 comment

Comments

@Nnemr
Copy link

Nnemr commented Oct 30, 2024

Exercise
10.4
Problem
The syntax for labels is incorrect. When you run docker-compose -f ./docker-compose.yml -f ./docker-compose-prod.yml config, the following error occurs:

parsing /mnt/d/projects/diamol/ch10/exercises/image-gallery/docker-compose-prod.yml: yaml: unmarshal errors:
  line 9: mapping key "x-labels" already defined at line 3

Docker version
Docker version 24.0.6, build ed223bc

Code version

commit 71384f8c09a8e0b3867a2c73ae09549774a21e85 (HEAD -> nnemr/update-ch10-exercise, origin/master, origin/HEAD, master)
Author: Elton Stoneman <[email protected]>
Date:   Fri Mar 5 15:43:14 2021 +0000

    Bump Apache versions
@ChoiWheatley
Copy link

Since "x-labels" defined at line 3 and line 9, you can avoid duplicated keys:

x-logging: &logging
  logging:
    options:
      max-size: '100m'
      max-file: '10'

x-labels: &labels
  app-name: image-gallery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants