From 2d7c42c80efd009062131114e166edf4692aa8d7 Mon Sep 17 00:00:00 2001
From: Tortue Torche <126358-tortuetorche@users.noreply.gitlab.com>
Date: Fri, 3 Sep 2021 10:45:40 +0200
Subject: [PATCH] Bump Docker Compose to 1.29.3 and upgrade OS
Use Docker Compose 1.29.3 instead of 1.28.3
Upgrade Operating System of Docker based images:
- With Alpine 3.14 (https://hub.docker.com/_/alpine)
- And Debian 11 (https://hub.docker.com/_/debian)
Reduce Docker image size
---
CHANGELOG.md | 5 +++++
Dockerfile | 13 ++++++++-----
Dockerfile.core | 6 ++++--
Dockerfile.debian | 9 ++++++---
Dockerfile.debian-core | 5 +++--
5 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1495e4b..522ad79 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Changed
+- Use Docker [Compose 1.29.3](https://github.com/docker/compose/releases/tag/1.29.2) instead of Docker [Compose 1.28.3](https://github.com/docker/compose/releases/tag/1.28.3)
+- Upgrade Operating System of Docker based images, with [Alpine 3.14](https://hub.docker.com/_/alpine) and [Debian 11](https://hub.docker.com/_/debian)
+- Reduce Docker images size
+
## [1.2.0-alpha] - 2021-02-19
### Added
- Test PSU with Portainer CE [2.0.1](https://app.swaggerhub.com/apis/deviantony/Portainer/2.0.1) API
diff --git a/Dockerfile b/Dockerfile
index 8bd8b81..1c5c8bb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,14 +1,17 @@
-FROM alpine:3.13
+FROM alpine:3.14
+
+ARG DOCKER_COMPOSE_VERSION_GTE=1.29.2
+ARG DOCKER_COMPOSE_VERSION_LT=1.30.0
RUN set -e; \
apk add --no-cache \
bash ca-certificates gettext jq \
- py3-pip python3-dev libc-dev libffi-dev openssl-dev gcc make musl-dev cargo; \
+ py3-pip python3-dev libc-dev libffi-dev openssl-dev gcc make musl-dev py3-wheel; \
\
- pip3 --no-cache-dir install 'docker-compose>=1.28.3,<1.29.0' 'httpie>=1.0.3,<1.1.0' 'cryptography>=3.3.2,<3.4.0'; \
+ pip3 --no-cache-dir install "docker-compose>=${DOCKER_COMPOSE_VERSION_GTE},<${DOCKER_COMPOSE_VERSION_LT}" "httpie>=1.0.3,<1.1.0" "cryptography>=3.3.2,<3.4.0"; \
\
- apk del python3-dev libc-dev libffi-dev openssl-dev gcc make musl-dev cargo; \
- rm -rf /tmp/src
+ apk del python3-dev libc-dev libffi-dev openssl-dev gcc make musl-dev py3-wheel; \
+ rm -rf $(find / -regex '.*\.py[co]')
ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \
diff --git a/Dockerfile.core b/Dockerfile.core
index ce00c26..ed621d1 100644
--- a/Dockerfile.core
+++ b/Dockerfile.core
@@ -1,8 +1,10 @@
-FROM alpine:3.13
+FROM alpine:3.14
RUN set -e; \
apk add --no-cache \
- bash ca-certificates gettext httpie jq
+ bash ca-certificates gettext jq py3-pip; \
+ pip3 --no-cache-dir install httpie; \
+ rm -rf $(find / -regex '.*\.py[co]')
ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \
diff --git a/Dockerfile.debian b/Dockerfile.debian
index 0144e02..aede26e 100644
--- a/Dockerfile.debian
+++ b/Dockerfile.debian
@@ -1,16 +1,19 @@
-FROM debian:10-slim
+FROM debian:11-slim
+
+ARG DOCKER_COMPOSE_VERSION=1.29.2
RUN set -e; \
apt-get update -yqq; \
apt-get install \
ca-certificates gettext-base httpie jq curl -yqq; \
\
- curl -fL "https://github.com/docker/compose/releases/download/1.28.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose; \
+ curl -fL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose; \
chmod +x /usr/local/bin/docker-compose; \
\
apt-get purge curl -y; \
apt-get clean; \
- rm -rf /var/lib/apt/lists/*
+ rm -rf /var/lib/apt/lists/*; \
+ rm -rf $(find / -regex '.*\.py[co]')
ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \
diff --git a/Dockerfile.debian-core b/Dockerfile.debian-core
index 61f06a3..24c80f3 100644
--- a/Dockerfile.debian-core
+++ b/Dockerfile.debian-core
@@ -1,4 +1,4 @@
-FROM debian:10-slim
+FROM debian:11-slim
RUN set -e; \
apt-get update -yqq; \
@@ -6,7 +6,8 @@ RUN set -e; \
ca-certificates gettext-base httpie jq -yqq; \
\
apt-get clean; \
- rm -rf /var/lib/apt/lists/*
+ rm -rf /var/lib/apt/lists/*; \
+ rm -rf $(find / -regex '.*\.py[co]')
ENV LANG="en_US.UTF-8" \
LC_ALL="C.UTF-8" \