I've installed docker with Snap Package Manager.
It says it has the latest version, but docker-compose gives error about the syntax which looks like it's not the latest version.
Example docker-compose.yml
version: '3.9'
services:
documentation:
image: nginx:latest
container_name: docs
volumes:
- ./site:/var/www/html
- ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./var/log/nginx:/var/log/nginx
networks:
my-net:
ipv4_address: 172.30.0.110
networks:
my-net:
external: true
name: my-net
On DigitalOcean
$ docker-compose --version
docker-compose version 1.27.4, build 40524192
And the docker-compose config command looks good.
On my Ubuntu with Docker in Snap
cops@emdev01:~/cops/documentation$ docker-compose --version
docker-compose version 1.25.5, build unknown
And the docker-compose config command gives the following output:
$ docker-compose config
ERROR: Version in "./docker-compose.yml" is unsupported.
You might be seeing this error because you're using the wrong Compose file version.
Either specify a supported version (e.g "2.2" or "3.3") 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/
The docker-compose used:
$ which docker-compose
/snap/bin/docker-compose
And the info shows the following:
$ sudo snap info docker
name: docker
summary: Docker container runtime
publisher: Canonical✓
store-url: https://snapcraft.io/docker
contact: https://github.com/docker-snap/docker-snap/issues?q=
license: (Apache-2.0 AND MIT AND GPL-2.0)
description: |
[SNIP]
services:
docker.dockerd: simple, enabled, active
snap-id: sLCsFAO8PKM5Z0fAKNszUOX0YASjQfeZ
tracking: latest/stable
refresh-date: today at 09:46 UTC
channels:
latest/stable: 20.10.8 2021-08-27 (1125) 122MB -
latest/candidate: 20.10.8 2021-09-29 (1234) 121MB -
latest/beta: 20.10.9 2021-10-08 (1310) 122MB -
latest/edge: 20.10.9 2021-11-09 (1399) 122MB -
17.03/stable: 17.03.2-ce-1 2017-07-20 (159) 42MB -
17.03/candidate: 17.03.2-ce-1 2017-06-30 (159) 42MB -
17.03/beta: ↑
17.03/edge: 17.03.2-ce-1 2017-06-30 (159) 42MB -
installed: 20.10.8 (1125) 122MB -
adminlinux@emdev01:~$
So, the above look like I'm using the latest Docker which is installed with Snap.
Then why do I get the error on the docker-compose file?