portainer / portainer

Making Docker and Kubernetes management easy.
https://www.portainer.io
zlib License
30.27k stars 2.43k forks source link

Docker-Compose version bundled with Portainer is too old #11206

Closed 0Styless closed 6 months ago

0Styless commented 6 months ago

Before you start please confirm the following.

Problem Description

The Docker-Compose version in the latest Portainer Image (portainer/portainer-ce:2.19.4-alpine) seems a little bit old:

./docker-compose --version
Docker Compose version v2.20.2

You can't use any new features of Docker-Compose with this version, for example (that is what I needed / want in my specific case) the feature to specify an app config inline: https://docs.docker.com/compose/compose-file/08-configs/#example-2

This feature is available with Docker-Compose version 2.23.1 and later and is a huge benefit when working with the GitOps workflow of Stack deployments.

Expected Behavior

The bundled Docker-Compose version should be at least in version 2.23.1 or even better v2.24.x (v2.24.6 is the latest stable version).

With this version, I can define an additional path for my Stack (with GitOps) and can deploy various configurations like this:

---
configs:
  configuration:
    content: |
      # Loads default set of integrations. Do not remove.
      default_config:
      tts:
        - platform: google_translate

      http:
        use_x_forwarded_for: true
        trusted_proxies:
          - 127.0.0.1

      zha:
        zigpy_config:
          ota:
            ledvance_provider: true # Auto update LEDVANCE/OSRAM

      frontend:
        themes: !include_dir_merge_named themes

      sensor:
        - platform: waste_collection_schedule
          name: garbage

Actual Behavior

Creation of the Stack fails with this message:

Additional property content is not allowed

Steps to Reproduce

  1. Go Stacks
  2. Add new Stack
  3. Add from Repository
  4. Repository must contain a docker-compose.yaml with a feature that is not supported in this version, e.g.:
---
version: "3.8"
services:
  home-assistant:
    image: ghcr.io/home-assistant/home-assistant:2024.2.1
    pull_policy: if_not_present
    restart: on-failure:5
    container_name: home-assistant
    network_mode: "host"
    privileged: true
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - /run/dbus:/run/dbus:ro
      - config:/config
    devices:
      - /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2667544-if00
    environment:
      TZ: "Europe/Berlin"
    configs:
      - source: configuration
        target: /config/configuration.yaml

volumes:
    config:

configs:
  configuration:
    content: |
      # Loads default set of integrations. Do not remove.
      default_config:
      tts:
        - platform: google_translate

      http:
        use_x_forwarded_for: true
        trusted_proxies:
          - 127.0.0.1

      zha:
        zigpy_config:
          ota:
            ledvance_provider: true # Auto update LEDVANCE/OSRAM

      frontend:
        themes: !include_dir_merge_named themes

      sensor:
        - platform: waste_collection_schedule
          name: garbage

Portainer logs or screenshots

No response

Portainer version

2.19.4

Portainer Edition

Community Edition (CE)

Platform and Version

Docker 25.0.1

OS and Architecture

Ubuntu 22.04 x86_64

Browser

Google Chrome

What command did you use to deploy Portainer?

docker run -d   --name portainer   --network portainer   -p 8000:8000   -p 9443:9443   -v /etc/localtime:/etc/localtime:ro   -v /etc/timezone:/etc/timezone:ro   -v portainer_data:/data   -v /var/run/docker.sock:/var/run/docker.sock   -e TZ='Europe/Berlin'  portainer/portainer-ce:2.19.4-alpine

Additional Information

Workaround (works for me, no problems so far) update the Docker-Compose binary by yourself and use a new Docker Image for it:

# Use the base image
FROM docker.io/portainer/portainer-ce:2.19.4-alpine

# Update the apk repositories and install required packages
RUN apk update && \
    apk upgrade && \
    apk add --no-cache curl

# Download and install specific version of Docker Compose
RUN curl -L -o /docker-compose https://github.com/docker/compose/releases/download/v2.24.6/docker-compose-linux-x86_64 && \
    chmod +x /docker-compose

# Set the working directory
WORKDIR /

Then do the manual "update" process as mentioned in the Portainer docs:

docker stop portainer
docker remove portainer

And start again with new image:

docker run -d   --name portainer   --network portainer   -p 8000:8000   -p 9443:9443   -v /etc/localtime:/etc/localtime:ro   -v /etc/timezone:/etc/timezone:ro   -v portainer_data:/data   -v /var/run/docker.sock:/var/run/docker.sock   -e TZ='Europe/Berlin'  portainer-compose:2.19.4-alpine
0Styless commented 6 months ago

Seems already to be upgraded in the trunk:

https://github.com/portainer/portainer/blame/develop/binary-version.json

{
  "docker": "v24.0.7",
  "dockerCompose": "v2.23.3",
  "helm": "v3.13.3",
  "kubectl": "v1.29.0",
  "mingit": "2.42.0.2"
}

So I guess this will be included in the next stable release?

jamescarppe commented 6 months ago

Yes, we update the versions of the third-party binaries we use in each release. Depending on when each new binary release comes out relative to our release and testing cycle, we may not always release with the latest version included - for example, if we had gone into our code freeze before a new version of the Compose binary had released, we may not include that new version as it would mean we would have to restart our testing process to take into account any changes in the new version.

0Styless commented 6 months ago

Sure that's fine. May I ask when the next stable release with these versions is planned?

jamescarppe commented 6 months ago

2.20 is currently in code freeze and undergoing testing, and we hope to have it out very soon.

flexchar commented 1 month ago

I spent so much trying to understand what is wrong and why I am running Portainer 2.19.5 and not 2.20.

Turns out docker run -d -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest will result in 2.19.5 version.

Hope it saves someelse's time!

@jamescarppe, perhaps you could look into why the latest tag is not properly applied? https://hub.docker.com/r/portainer/portainer-ee/tags?page=&page_size=&ordering=&name=latest

Okay, it's my bad. I forgot about this... https://www.portainer.io/blog/portainer-2.20-release

I think you guys should be more explicit in the tags themselves about what it is.

jamescarppe commented 1 month ago

I think you guys should be more explicit in the tags themselves about what it is.

The STS/LTS system is a new process as per this blog post and our intent is to have our LTS versions (of which 2.21 will be the first) on the :latest tag with the most recent STS version on the :sts tag. The reasoning behind this is that we want people that are using the :latest tag to be on the most stable version we can provide, which will be LTS. We'll of course also continue to have all versions on their own specific version tag (like :2.20.3).