microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
175 stars 26 forks source link

Docker Compose YAML Parsing Regression in 17.5.0/17.5.1 #372

Closed cjbush closed 2 months ago

cjbush commented 1 year ago

It looks like the docker compose parsing step in MSBuild is now failing for extension fields as of 17.5.0.

I've created a basic reproduction here: https://github.com/cjbush/docker-compose-problem

In 17.4.5, the project runs as expected. Starting with 17.5.0, I get the following error when I build/run my docker compose project:

Severity Code Description Project File Line Suppression State Error DT1004 (Line: 10, Col: 12, Idx: 205) - (Line: 10, Col: 29, Idx: 222): Unable to parse environment variables in Docker Compose YML files. docker-compose docker-compose-problem\src\WebApplication1\docker-compose.yml 10

gsimantiras commented 1 year ago

same issue I am facing

VS 17.5.1 Docker Engine Version: 20.10.7 docker-compose version 1.29.2

Note that IT WORKS when installing a previous version of VS: LTSC 17.4 (because I cannot rollback from 17.5.1 to 17.4) and trying the same project (with same docker version)

cjbush commented 1 year ago

One other tangentially related note, I happened to notice that rolling back to 17.4.5 blew away all my installed extensions. So if anybody comes here and goes that route, be sure to save off a list of what you've got installed.

NCarlsonMSFT commented 1 year ago

@cjbush FYI there is a feature Roaming Extension Manager built into VS to help you re-install your extensions any time you install, or re-install, VS

cjbush commented 1 year ago

@NCarlsonMSFT Good to know, thanks. Back in the day I had a third party extension by Mads Kristensen that did something kind of similar but I didn't have it installed this time around.

gsimantiras commented 1 year ago

We've moved on with the official docker-compose documentation, creating an .env file for all the variables and adding them to each service like so: myservice: image: ${DOCKER_REGISTRY-}myservice build: context: . dockerfile: MyService/Dockerfile env_file: .env environment: ...

WilWa commented 1 year ago

I've run into this issue, and wanted to add that I was able to install LTSC 17.4 (https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#evergreen-bootstrappers) alongside the latest release without any issues.

(I changed the installation location to C:\Program Files\Microsoft Visual Studio\2022LTSC174\Professional instead of the default. The Visual Studio Installer supports multiple installations.)

dbreshears commented 2 months ago

Close as verified this is fixed in latest builds.