puppetlabs / puppetlabs/puppetlabs-docker

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

Open
#903 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug community
Dominant language
Ruby
Stars
94
Forks
337
Avg merge
11d 15h
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Puppet docker class and trace how its package resources apply the version option to docker-ce and docker-ce-cli. Reproduce the report on Ubuntu 20.04 with version 5:20.10.213-0ubuntu-focal, then verify that both installed packages and Docker client/server report the requested version.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ruby, ubuntu
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.