geerlingguy / ansible-role-docker

Ansible Role - Docker
https://galaxy.ansible.com/geerlingguy/docker/
MIT License
1.8k stars 851 forks source link

Update docker version #450

Open gaiziRepo opened 5 months ago

gaiziRepo commented 5 months ago

Hello, how can i update the docker version ?

I have an old version installed with the role geerlingguy.docker version 4.2.1 and the docker version istalled is 19.03.13.

I'm using geerlingguy.docker version 7.1.0 now and i want to update docker to it's latest version 26.0.

I did specify : docker_packages_state: latest docker_packages:

But it does not seem to work. how can i update docker version ? did i miss a step ?

linuxbandit commented 2 months ago

@gaiziRepo you didn't know, but your question is not related to the ansible role per se, because the name of the version of docker depends on your package manager: as an example, this is for Ubuntu 18 5:{{ docker_version }}~3-0~ubuntu-bionic

therefore, to install a specific pinned version of docker, you should do, on ubuntu 18:

docker_version: "19.03.15"
docker_ubuntu_version: "5:{{ docker_version }}~3-0~ubuntu-bionic" 
docker_packages:
      - "docker-{{ docker_edition }}={{docker_ubuntu_version}}"

I put extra verbosity to relay the concept. docker_packages is the role's only variable, the others are for you to remember that the version is 19.03.15, and that it has an awful name in ubuntu 18's repos

HTH

elburro1887 commented 1 month ago

You can run this command to see the OS Specific version strings apt-cache madison docker-ce | awk '{ print $3 }'

from: https://docs.docker.com/engine/install/debian/#install-using-the-repository