I was using version: '3' for the docker-compose, works fine in my host machine (macOS), but when I tried to build the images and run the containers in the server, I got the response
Version in "./docker-compose.dev.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
OS Ubuntu "16.04.6 LTS (Xenial Xerus)" in AWS (ec2)
Docker version 19.03.8
docker-compose version 1.8.0, build unknown
I found a way around and it is to use version 2, How can I solve this?
Related
I've a solution with 2 WEB API items and both have docker support so i can debug them in docker.
I've also had the dockercompose so i could test them like the compose in the running environment. However after a problem with docker desktop and did a reinstall of docker desktop i can't have VS2022 working with docker compose again.
below a part of the log file of visual studio when i load my solution
SetSite failed for package [DockerComposePackage]Source: 'System.ComponentModel.Composition' Description: Cannot cast the underlying exported value of type 'Docker.Compose' to type 'Microsoft.VisualStudio.Containers.Tools.Common.Commands.ICommandManager'.
Im new to Docker and followed very simple steps in my Mac(Intel Version). Downloaded Docker and moved to applications. Post that, I have tried docker-compse for almost 10 different images available from docker website. No matter which images, I always end at the error filesystem layer verification failed for digest sha256
I have tried few solutions which are out there. But none have resolved the issue.
Appreciate any help from the community here!
Additional Details -
Mac OS: Catalina 10.15.7
Docker Version: 20.10.16
Docker-compose Version: 1.29.2
I have docker-compose 1.25.4 on a system, and docker 19.03. How do I know which version of Compose file format it supports, without trying a bunch or searching through release notes etc?
I determined by trial and error that the highest Compose file format version that docker-compose 1.25.4 supports is 3.7. Therefore, my docker-compose.yml requires version: "3.7".
But what if I need to determine this programmatically? Or reliably, without trial and error, and without looking at release notes?
The docs at https://docs.docker.com/compose/compose-file/compose-versioning/ suggest that highest version should be 3.8 but this does not work. Indeed the release notes indicate that 3.8 became supported as of docker-compose 1.25.5.
I looked through various docker-compose commands and could not spot anything that would say "This version of docker-compose supports Compose file version up to x.y".
I figured out that there is no way to find this out via the cli.
You need to check the docker-compose github releases for this.
For example on Ubuntu: v1.25.0 version of docker-compose which is currently the latest and gets to be installed by default, but it is compatible with the 3.7 at highest.
https://github.com/docker/compose/releases/tag/1.25.0
The Compose file format compatibility matrix part is the interesting here.
I would like to make sure that I'm using version 3 of the compose file format. However, on https://docs.docker.com/compose/compose-file/ I was not able to find out how to do this.
My Docker version is 17.04.0-ce, build 4845c56, and my Docker-Compose version is docker-compose version 1.9.0, build 2585387. I'm not sure since when version 3 of the compose file format was introduced, however. How can I find this out?
It's on your docker-compose.yml file. First parameter is Docker Compose version.
version: '3'
Docker Compose version file 3 was introduced in release 1.10.0 of Docker Compose and 1.13.0 release of Docker Engine.
Here you can see release notes for Docker Compose 1.10.0 which introduces version file 3: https://github.com/docker/compose/releases/tag/1.10.0
The docker compose version 3 syntax requires docker version 1.13 and docker-compose version 1.10 (see the release notes). See the release notes for the version compatibility matrix and upgrade instructions.
Note that the version 3 syntax is designed for docker swarm mode, and it was first supported with the docker stack deploy in docker release 1.13. There's not much reason to upgrade to the version 3 syntax if you are still using docker-compose itself.
See also the compose file versioning page that describes the differences between the different yml versions.
Let's say I have a cross-platform environment,
my app is deployed twice - once on windows container and one on a Linux container,
In addition, I have a DB container (Linux).
Can I use docker compose to build those 3 services?
I think not - because the images I use are built for a certain os type.
Am I right? and maybe I am wrong and there is a workaround for this?
Compose files using version 2.4 support the platform options, which allows for specifying the platform of the service.
platform: osx
platform: windows/amd64
platform: linux/arm64/v8
https://github.com/docker/docker.github.io/blob/master/compose/compose-file/compose-file-v2.md#platform
It should be noted that the platform option is not supported on v3 compose files.
A more in-depth explanation can be found here: https://devblogs.microsoft.com/premier-developer/mixing-windows-and-linux-containers-with-docker-compose/