Conversation
| remove_files(name_tmp_file) | ||
|
|
||
| if self.version and isinstance(self.version, str): | ||
| self.compose_dict["version"] = self.version |
There was a problem hiding this comment.
If I still this stack config version along with old docker versions, would the deployment will fail ? with which version of docker this is not recognized anymore ?
There was a problem hiding this comment.
I got confused with changes between docker compose config & docker stack config.
docker compose config depricated the spec version's and it will be ignored while doing docker compose up
Compose v1 was first released in 2014. It was written in Python and invoked with docker-compose. Typically, Compose v1 projects include a top-level version element in the compose.yaml file, with values ranging from 2.0 to 3.8, which refer to the specific file formats.
Compose v2, announced in 2020, is written in Go and is invoked with docker compose. Unlike v1, Compose v2 ignores the version top-level element in the compose.yaml file and relies entirely on the Compose Specification to interpret the file.
Ref:
There was a problem hiding this comment.
But docker stack works differently.
The docker stack deploy command uses the legacy Compose file version 3 format, used by Compose V1. The latest format, defined by the Compose specification isn't compatible with the docker stack deploy command.
There was a problem hiding this comment.
[isadmin@pf-65 scripts]$ docker compose -f docker-compose.yml pull
WARN[0000] /opt/iservices/scripts/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] pull 9/9
✔ Image registry.scilo.tools/sciencelogic/sa-gui:3.3.1 Pulled 0.5s
✔ Image registry.scilo.tools/internal/sa-mcp:0.2.0 Pulled 0.6s
✔ Image registry.scilo.tools/sciencelogic/sa-pypi:6.3.1-17 Pulled 0.5s
✔ Image registry.scilo.tools/sciencelogic/sa-worker:rhel3.3.1 Pulled 0.5s
✔ Image registry.scilo.tools/sciencelogic/sa-dex:2.37.1-13 Pulled 0.5s
✔ Image registry.scilo.tools/sciencelogic/sa-api:rhel3.3.1 Pulled 0.5s
✔ Image registry.scilo.tools/sciencelogic/sa-rabbit:3.8.35-9 Pulled 0.4s
✔ Image registry.scilo.tools/sciencelogic/sa-couchbase:6.6.0-16 Pulled 0.5s
✔ Image registry.scilo.tools/sciencelogic/sa-redis:7.4.8-0 Pulled
This check is to validate docker compose config ignores version property.
[isadmin@pf-65 scripts]$ docker compose -f docker-compose-override.yml -f docker-compose.yml config
WARN[0000] /opt/iservices/scripts/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
I did this check just to validate it respects version property.
[isadmin@pf-65 scripts]$ docker stack config -c docker-compose.yml -c docker-compose-override.yml
unsupported Compose file version: 2.13
There was a problem hiding this comment.
awesome, thanks for the explanation!
| cmd = ["docker", "stack", "config"] | ||
| for f in self.files: | ||
| cmd.extend(["-c", f]) | ||
| cmd.append("--skip-interpolation") |
There was a problem hiding this comment.
I just noticed this. Are we sure this --skip-interpolation is the same as "--no-interpolate": False ?
I mean, --no-interpolate": False this being set to false, doesn't that mean this flag is disabled ? which would mean interpolate is enabled ?
There was a problem hiding this comment.
My bad! you are right. I will validate and fix it.
1.1.0