Coder Social home page Coder Social logo

Comments (4)

do-web avatar do-web commented on April 30, 2024

I have the problem, i am getting now "unsupported Compose file version: 1.0"

With my docker compose file, before the update all works fine.

version: "3.7"

services:
  km:
    image: ${IMAGE}
    environment:
      - WEB_DOCUMENT_ROOT=/var/www/public
    deploy:
      mode: replicated
      replicas: 1
      restart_policy:
        condition: on-failure
      labels:
        caddy: ${CADDY_DOMAIN}
        caddy.reverse_proxy: "{{upstreams 80}}"

networks:
  default:
    external:
      name: caddy_caddy

from docker-with-compose.

tiangolo avatar tiangolo commented on April 30, 2024

It seems you have an older Docker version. So, in the latest version of the Docker Compose file format, the version key is not required and is there only for backwards compatibility: https://github.com/compose-spec/compose-spec/blob/master/spec.md#version-top-level-element

But in previous versions of the spec, it was required to add version: 3 or version: 2, and if it was omitted, it was assumed to be version: 1: https://docs.docker.com/compose/compose-file/compose-versioning/#versioning

But in recent versions of the spec, the version key is no longer required again.

So, you should probably update the Docker version you are using. If you can't do that, you can pin the tag of the Docker image using a date tag like tiangolo/docker-with-compose:2021-09-17. Use the latest date tag that works for you: https://hub.docker.com/r/tiangolo/docker-with-compose/tags

from docker-with-compose.

Ousret avatar Ousret commented on April 30, 2024

I think that there is a misunderstanding here.
We are well aware of Docker/compose changes in the past year or so.

docker compose plugin (v2) is supposed to be invoked with docker compose instead of docker-compose for backward compatibility purposes.

nothing in this project changeset allows us from understanding it.

Latest Changes
👷 Add GitHub Action for Docker Hub description. PR https://github.com/tiangolo/docker-with-compose/pull/41 by [@tiangolo](https://github.com/tiangolo).
⬆️ Upgrade CI OS. PR https://github.com/tiangolo/docker-with-compose/pull/40 by [@tiangolo](https://github.com/tiangolo).
🔧 Add funding config. PR https://github.com/tiangolo/docker-with-compose/pull/39 by [@tiangolo](https://github.com/tiangolo).
👷 Add automatic scheduled CI every monday. PR https://github.com/tiangolo/docker-with-compose/pull/38 by [@tiangolo](https://github.com/tiangolo).
👷 Add automatic scheduled CI every Monday. PR https://github.com/tiangolo/docker-with-compose/pull/37 by [@tiangolo](https://github.com/tiangolo).
📝 Update README, replace bash with shell, as Bash itself is not installed. PR https://github.com/tiangolo/docker-with-compose/pull/36 by [@tiangolo](https://github.com/tiangolo).
👷 Add alls-green GitHub Action. PR https://github.com/tiangolo/docker-with-compose/pull/35 by [@tiangolo](https://github.com/tiangolo).
👷 Do not run double CI for PRs, run on push only on master. PR https://github.com/tiangolo/docker-with-compose/pull/34 by [@tiangolo](https://github.com/tiangolo).
⬆️ Bump tiangolo/issue-manager from 0.3.0 to 0.4.0. PR https://github.com/tiangolo/docker-with-compose/pull/28 by [@dependabot[bot]](https://github.com/apps/dependabot).
........

Then

ousret@ubuntu:~$ docker run tiangolo/docker-with-compose:latest docker-compose --version
Unable to find image 'tiangolo/docker-with-compose:latest' locally
latest: Pulling from tiangolo/docker-with-compose
Digest: sha256:78700d4aa8d33019199033a93957738b9978d906f7f62304ef36ebc547a358fb
Status: Downloaded newer image for tiangolo/docker-with-compose:latest
Docker Compose version v2.12.2

Also...

ousret@ubuntu:~$ docker run docker:latest docker-compose --version
Unable to find image 'docker:latest' locally
latest: Pulling from library/docker
Digest: sha256:4ae1444ef191366429581854edcf0a16f260b7a0ed90f4d5d1d95265356642ae
Status: Downloaded newer image for docker:latest
Docker Compose version v2.12.2

So this image is becoming useless and that does not seem to bother you.

Everything after FROM docker:latest is rendered useless.
Installing docker-compose from pip targets the 1.x version.

Additional reading for why some may need to remain in v1 docker/cli#2527
Also, some companies may take longer to migrate.

Thanks anyway.

from docker-with-compose.

tiangolo avatar tiangolo commented on April 30, 2024

Ah! Thanks for the clarification.

I don't appreciate the bitter accusation, though. I've been doing this for free, for anyone to use it, in my free time. I would appreciate if you could restrain from these types of accusations when interacting with free open source projects, and asking for free support on issues.

I'll investigate this later.

from docker-with-compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.