Change the docker daemon name in Debian 9 on Arm

Enable docker-ce on AArch64 platform in Debian.
Set the docker daemon name according to the existing of "dockerd" binary.

Closes-Bug: #1734255

Co-authored-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

Change-Id: Ie0b3bac72b408dccf3fb99912b4fe2d4788705e5
Signed-off-by: Tone.Zhang <tone.zhang@arm.com>
This commit is contained in:
Tone.Zhang 2017-11-24 13:43:34 +08:00
parent 3aa21d78c5
commit 3886918c1f
5 changed files with 22 additions and 9 deletions

View File

@ -1,6 +1,7 @@
---
docker_apt_url: "https://apt.dockerproject.org"
docker_apt_key_id: F76221572C52609D
docker_apt_url: "{{ 'http://obs.linaro.org/ERP:/17.12/Debian_9' if ansible_architecture == 'aarch64' else 'https://apt.dockerproject.org' }}"
docker_apt_key_file: "{{ 'Release.key' if ansible_architecture == 'aarch64' else 'gpg' }}"
docker_apt_key_id: "{{ 'C32DA102AD89C2BE' if ansible_architecture == 'aarch64' else 'F76221572C52609D' }}"
docker_yum_url: "https://yum.dockerproject.org"
docker_gpg_fingerprint: "58118E89F3A912897C070ADBF76221572C52609D"
@ -16,7 +17,7 @@ disable_selinux: True
docker_storage_driver: ""
debian_pkg_install:
- docker-engine=1.12.*
- "{{ 'docker-ce' if ansible_architecture == 'aarch64' else 'docker-engine=1.12.*' }}"
- git
- python-setuptools
- ntp

View File

@ -6,6 +6,16 @@
recurse: yes
become: True
- name: Check dockerd exists
stat: path=/usr/bin/dockerd
register: dockerd_exists
- name: Setting docker daemon name
set_fact:
docker_binary_name: "dockerd"
when:
dockerd_exists.stat.exists == True
- name: Configure docker service
become: True
template:

View File

@ -77,7 +77,7 @@
become: True
when: ansible_os_family == 'Debian'
- name: Install ubuntu ca certs
- name: Install ca certs
package:
name: "{{ item }}"
state: latest
@ -105,13 +105,11 @@
- name: Install docker apt gpg key
apt_key:
url: "{{ docker_apt_url }}/gpg"
url: "{{ docker_apt_url }}/{{ docker_apt_key_file }}"
id: "{{ docker_apt_key_id }}"
state: present
become: True
when:
- ansible_os_family == 'Debian'
- ansible_distribution == 'Ubuntu'
when: ansible_os_family == 'Debian'
- name: Ensure yum repos directory exists
file:

View File

@ -1,2 +1,6 @@
{% if ansible_architecture == 'aarch64' %}
deb {{ docker_apt_url }} ./
{% else %}
# main docker repo
deb {{ docker_apt_url }}/repo {{ ansible_distribution | lower }}-{{ ansible_distribution_release | lower }} main
{% endif %}

View File

@ -1,4 +1,4 @@
[Service]
MountFlags=shared
ExecStart=
ExecStart=/usr/bin/docker daemon{% if docker_registry %} --insecure-registry {{ docker_registry }}{% endif %}{% if docker_storage_driver %} --storage-driver {{ docker_storage_driver }}{% endif %}
ExecStart=/usr/bin/{{ docker_binary_name|default("docker daemon", true) }}{% if docker_registry %} --insecure-registry {{ docker_registry }}{% endif %}{% if docker_storage_driver %} --storage-driver {{ docker_storage_driver }}{% endif %}