From 9474084f3fd9d926c57d552655534be6a152737f Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Mon, 11 Nov 2024 18:07:06 +0800 Subject: [PATCH] Update Dockerfile with improved version matching --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index eee76c2..f8e5fd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 -ARG docker_version="20.10.17" +ARG docker_version="27.3.1" ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ @@ -12,8 +12,7 @@ RUN apt-get update \ | tee /etc/apt/sources.list.d/docker.list > /dev/null \ && apt-get update \ && apt-get install -y --no-install-recommends locales ufw \ - && ( apt-get install -y --no-install-recommends "docker-ce=5:${docker_version}~*" || \ - apt-get install -y --no-install-recommends "docker-ce=${docker_version}~*" ) \ + && apt-get install -y --no-install-recommends "docker-ce=$(apt-cache madison docker-ce | grep -m1 -F "${docker_version}" | cut -d'|' -f2 | tr -d '[[:blank:]]')" \ && locale-gen en_US.UTF-8 \ && apt-get clean autoclean \ && apt-get autoremove --yes \