From 62f74c13f1486e88b5d4bcdf6bd37700be1e14de Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Sat, 13 Jul 2024 11:55:40 +0200 Subject: [PATCH] Upgrade Docker (#11) --- .github/workflows/build.yml | 5 +++-- playbooks/docker.yml | 9 +++++++++ playbooks/dockercompose.yml | 2 +- playbooks/roles/docker/tasks/main.yml | 12 ++++++------ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f37a3b3..ff838de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,10 +78,11 @@ jobs: docker exec -t containertest npm -v - name: docker run: | - docker exec -t containertest ansible-playbook docker.yml -e ansible_become_pass=jhipster -u jhipster + docker exec -t containertest ansible-playbook docker.yml -e ansible_become_pass=jhipster -u jhipster \ + -e container_version=1.7.18-1 -e docker_version=27.0.3-1 docker exec -t containertest docker -v docker exec -t containertest groups jhipster - name: docker-compose run: | - docker exec -t containertest ansible-playbook dockercompose.yml -e ansible_become_pass=jhipster -e docker_compose_version=2.5.1 + docker exec -t containertest ansible-playbook dockercompose.yml -e ansible_become_pass=jhipster -e docker_compose_version=2.28.1 docker exec -t containertest docker-compose version diff --git a/playbooks/docker.yml b/playbooks/docker.yml index efcdf5d..f409bea 100644 --- a/playbooks/docker.yml +++ b/playbooks/docker.yml @@ -2,3 +2,12 @@ - hosts: localhost roles: - docker + vars_prompt: + - name: container_version + prompt: 'Choose your container.io version' + default: '1.7.18-1' + private: no + - name: docker_version + prompt: 'Choose your Docker version' + default: '27.0.3-1' + private: no diff --git a/playbooks/dockercompose.yml b/playbooks/dockercompose.yml index 2e82c62..e60c1bc 100644 --- a/playbooks/dockercompose.yml +++ b/playbooks/dockercompose.yml @@ -4,5 +4,5 @@ vars_prompt: name: docker_compose_version prompt: 'Choose your Docker-Compose version' - default: '2.5.1' + default: '2.28.1' private: no diff --git a/playbooks/roles/docker/tasks/main.yml b/playbooks/roles/docker/tasks/main.yml index fe8778a..d16bdd2 100644 --- a/playbooks/roles/docker/tasks/main.yml +++ b/playbooks/roles/docker/tasks/main.yml @@ -1,30 +1,30 @@ --- - name: Download container.io get_url: - url: 'https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/containerd.io_1.6.21-1_amd64.deb' + url: 'https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/containerd.io_{{container_version}}_amd64.deb' dest: /tmp/ - name: Download docker-ce-cli get_url: - url: 'https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce-cli_24.0.1-1~ubuntu.22.04~jammy_amd64.deb' + url: 'https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce-cli_{{docker_version}}~ubuntu.22.04~jammy_amd64.deb' dest: /tmp/ - name: Download docker-ce get_url: - url: 'https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce_24.0.1-1~ubuntu.22.04~jammy_amd64.deb' + url: 'https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce_{{docker_version}}~ubuntu.22.04~jammy_amd64.deb' dest: /tmp/ - name: Install container.io become: true apt: - deb: /tmp/containerd.io_1.6.21-1_amd64.deb + deb: /tmp/containerd.io_{{container_version}}_amd64.deb - name: Install docker-ce-cli become: true apt: - deb: /tmp/docker-ce-cli_24.0.1-1~ubuntu.22.04~jammy_amd64.deb + deb: /tmp/docker-ce-cli_{{docker_version}}~ubuntu.22.04~jammy_amd64.deb - name: Install docker-ce become: true apt: - deb: /tmp/docker-ce_24.0.1-1~ubuntu.22.04~jammy_amd64.deb + deb: /tmp/docker-ce_{{docker_version}}~ubuntu.22.04~jammy_amd64.deb - name: Add to Docker group become: true