geerlingguy / ansible-role-docker_arm

Ansible Role - Docker for ARM and Pi
MIT License
98 stars 29 forks source link

Installation failure with Docker 20.10.6 on Debian GNU/Linux 11 (bullseye) #35

Closed jonathantullett closed 2 years ago

jonathantullett commented 2 years ago

Hello,

I am using this role to install docker onto a raspberry pi 4, 64Bit install. This is the playbook

$ cat playbooks/install-docker-skelton.yml
---
- hosts: docker_rpi
  become: yes
  vars:
    docker_compose_version: 1.29.2
    docker_version_arm64: 5:20.10.6~3-0~debian-bullseye

    pip_package: python3-pip
    pip_executable: pip3
    pip_install_packages:
      - name: setuptools
      - name: docker
      - name: docker-compose

  roles:
    - geerlingguy.pip
    - geerlingguy.docker_arm

And the output is:

PLAY [docker_rpi] ************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************************************
ok: [tn4pi02]

TASK [geerlingguy.pip : Ensure Pip is installed.] ****************************************************************************************************************************************************************
fatal: [tn4pi02]: FAILED! => {"changed": false, "msg": "E:Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/debian/ bullseye: /usr/share/keyrings/docker-archive-keyring.gpg != , E:The list of sources could not be read."}

Checking the local filesystem:

# cat /etc/apt/sources.list.d/docker.list 
deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable

And comparing the key here with https://download.docker.com/linux/debian/gpg:

9f3702d8745994675fc9003c6e2b5b26  /usr/share/keyrings/docker-archive-keyring.gpg
1afae06b34a13c1b3d9cb61a26285a15  /dev/fd/63

So they are indeed different.

I've seen this related issue open, but am unsure how to wrangle that into this role

Is there a quick fix for this? Thanks very much, Jonathan.

jonathantullett commented 2 years ago

I've just repeated the process on a fresh install, and see the same thing. /etc/apt/sources.list.d has nothing docker related in it, then the playbook runs:

PLAY [docker_rpi] ************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************************************
ok: [pi01]

TASK [geerlingguy.pip : Ensure Pip is installed.] ****************************************************************************************************************************************************************
ok: [pi01]

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] **********************************************************************************************************************************************
ok: [pi01] => (item={'name': 'setuptools'})
ok: [pi01] => (item={'name': 'docker'})
ok: [pi01] => (item={'name': 'docker-compose'})

TASK [geerlingguy.docker_arm : Check if Docker is already present.] **********************************************************************************************************************************************
ok: [pi01]

TASK [geerlingguy.docker_arm : Download Docker install convenience script.] **************************************************************************************************************************************
changed: [pi01]

TASK [geerlingguy.docker_arm : Run Docker install convenience script.] *******************************************************************************************************************************************
fatal: [br3pi01]: FAILED! => {"changed": true, "cmd": ["/tmp/get-docker.sh"], "delta": "0:00:06.216901", "end": "2022-03-28 18:44:40.943032", "msg": "non-zero return code", "rc": 100, "start": "2022-03-28 18:44:34.726131", "stderr": "+ sh -c apt-get update -qq >/dev/null\n+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null\n+ sh -c curl -fsSL \"https://download.docker.com/linux/debian/gpg\" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg\n+ sh -c echo \"deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable\" > /etc/apt/sources.list.d/docker.list\n+ sh -c apt-get update -qq >/dev/null\nE: Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/debian/ bullseye: /usr/share/keyrings/docker-archive-keyring.gpg != \nE: The list of sources could not be read.", "stderr_lines": ["+ sh -c apt-get update -qq >/dev/null", "+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null", "+ sh -c curl -fsSL \"https://download.docker.com/linux/debian/gpg\" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg", "+ sh -c echo \"deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable\" > /etc/apt/sources.list.d/docker.list", "+ sh -c apt-get update -qq >/dev/null", "E: Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/debian/ bullseye: /usr/share/keyrings/docker-archive-keyring.gpg != ", "E: The list of sources could not be read."], "stdout": "# Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be", "stdout_lines": ["# Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be"]}

PLAY RECAP *******************************************************************************************************************************************************************************************************
pi01                    : ok=13   changed=1    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0   

FWIW, this is the contents of /tmp/get-docker.sh:

# /tmp/get-docker.sh 
# Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be
+ sh -c apt-get update -qq >/dev/null
E: Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/debian/ bullseye: /usr/share/keyrings/docker-archive-keyring.gpg != 
E: The list of sources could not be read.

Thanks for any help you can provide.

jonathantullett commented 2 years ago

I have upgraded the galaxy role from v4.0.0 to v5.0.0 to no avail. Now out of ideas myself.

jonathantullett commented 2 years ago

I'm going to close this now. After a few goes of getting funky inconsistencies, I rebooted the device and now it's run successfully first time. I'll revisit on my next build, should it occur again.