Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

docker_pull_run_remove: add test for cpu-shares flag #415

Merged
merged 1 commit into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions roles/docker_pull_run_remove/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
# popular_images is defined in roles/docker_pull_run_remove/vars/main.yml
#
- name: Pull the popular images from Docker Hub
command: "docker pull docker.io/{{ item }}"
command: "docker pull {{ item }}"
with_items: "{{ popular_images }}"
register: dpd
retries: 5
delay: 60
until: dpd|success

- name: Run the popular images
command: "docker run --rm docker.io/{{ item }} echo 'hello'"
command: "docker run --rm {{ item }} echo 'hello'"
with_items: "{{ popular_images }}"

# Test for https://bugzilla.redhat.com/show_bug.cgi?id=1585735
- name: Run the popular images with cpu-shares flag
command: "docker run --cpu-shares 2 --rm {{ item }} echo 'hello'"
with_items: "{{ popular_images }}"

- name: Remove the popular images
command: "docker rmi docker.io/{{ item }}"
command: "docker rmi {{ item }}"
with_items: "{{ popular_images }}"
9 changes: 6 additions & 3 deletions roles/docker_pull_run_remove/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# vim: set ft=ansible:
#
popular_images:
- alpine
- busybox
- ubuntu
- docker.io/alpine
- docker.io/busybox
- docker.io/ubuntu
- registry.fedoraproject.org/fedora
- registry.centos.org/centos
- registry.access.redhat.com/rhel