Monday, February 24, 2020

A cool tool to validate the yaml content on building the docker-compose.yml file.

after i added a docker-compose project the asp.net solution, then i try to build the docker-compose file to generate all the images.

however i always encounter error without specific message. the root of cause this issue is that
YAML follows indentation structure very strictly. one extra space or tab will cause this issue.

this online tool will be a great help on validation your content in YAML.

https://onlineyamltools.com/validate-yaml

here is my sample docker-compose file, after i pasted it in the yaml box, the line causes the issue highlights immediately in the errors box

version: '3.7'

services:
  webapi_dotnetcore:
    image: ${DOCKER_REGISTRY-}webapidotnetcore
    build:
      context: .
      dockerfile: WebAPI_DotNetCore/Dockerfile

  db:
    image: mcr.microsoft.com/mssql/server
    environment:
         - ACCEPT_EULA=Y
         - SA_PASSWORD=Password_01
  ports:
   - '1433:1433'


No comments:

Post a Comment