puppetlabs-docker icon indicating copy to clipboard operation
puppetlabs-docker copied to clipboard

docker-ce and docker-ce-cli version mismatch when the 'version' option set

Open vitargelo opened this issue 2 years ago • 1 comments

Describe the Bug

When the version option is set to a specific version, docker-ce-cli package latest version installed.

  class { 'docker':
    version        => '5:20.10.21~3-0~ubuntu-focal',
    ip_forward     => false,
    iptables       => false,
    ip_masq        => false,
    log_driver     => 'json-file',
  }

And the result:

$ docker -v

Docker version 23.0.1, build a5ee5b1

$ docker version

Client: Docker Engine - Community
 Version:           23.0.1
 API version:       1.41 (downgraded from 1.42)
 Go version:        go1.19.5
 Git commit:        a5ee5b1
 Built:             Thu Feb  9 19:46:56 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       3056208
  Built:            Tue Oct 25 18:00:04 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.18
  GitCommit:        2456e983eb9e37e47538f59ea18f2043c9a73640
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Expected Behavior

Both, the docker engine and docker CLI have the same defined version (20.10.21)

Environment

  • Version [6.0.1]
  • Platform [Ubuntu 20.04]

Additional Context

When trying to install a specific version of the docker-ce package with apt, for some reason it installs the latest docker-ce-cli version as a dependency. Official docker documentation says that we need to set a specific version for both packages in a single command.

 VERSION_STRING=5:20.10.13~3-0~ubuntu-jammy
 sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin

Maybe possible solution is to set-up docker-ce-cli before docker-ce with puppet package resource.

vitargelo avatar Feb 27 '23 11:02 vitargelo

Related issues: #895 #865

vitargelo avatar Feb 27 '23 11:02 vitargelo