From e4e8cf494288c5e63dfe38463730992fcd186543 Mon Sep 17 00:00:00 2001 From: Devon Steenberg Date: Tue, 19 May 2026 09:37:42 +1200 Subject: [PATCH] fix(docker): remove docker binary from ce/ee images [BE-12917] (#2674) --- Makefile | 2 +- binary-version.json | 3 --- build/build_binary.sh | 8 +------ build/download_binaries.sh | 28 ---------------------- build/download_docker_binary.sh | 41 --------------------------------- build/linux/Dockerfile | 1 - build/linux/alpine.Dockerfile | 1 - build/windows/Dockerfile | 3 +-- pkg/build/info.go | 2 +- 9 files changed, 4 insertions(+), 85 deletions(-) delete mode 100644 binary-version.json delete mode 100755 build/download_binaries.sh delete mode 100755 build/download_docker_binary.sh diff --git a/Makefile b/Makefile index 951f7c5fda..64f40ad337 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,8 @@ build-storybook: ## Build and serve the storybook files .PHONY: deps server-deps client-deps tidy deps: server-deps client-deps ## Download all client and server build dependancies +## This is empty because the pipeline requires it but ce has no server deps server-deps: init-dist ## Download dependant server binaries - @./build/download_binaries.sh $(PLATFORM) $(ARCH) client-deps: ## Install client dependencies pnpm install diff --git a/binary-version.json b/binary-version.json deleted file mode 100644 index 2730d91db1..0000000000 --- a/binary-version.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "docker": "v29.4.1" -} diff --git a/build/build_binary.sh b/build/build_binary.sh index 2ed3617e62..cfa8883ad3 100755 --- a/build/build_binary.sh +++ b/build/build_binary.sh @@ -2,12 +2,6 @@ set -euo pipefail BUILD_SOURCESDIRECTORY=${BUILD_SOURCESDIRECTORY:-$(pwd)} -BINARY_VERSION_FILE="$BUILD_SOURCESDIRECTORY/binary-version.json" - -if [[ ! -f $BINARY_VERSION_FILE ]] ; then - echo 'File $BINARY_VERSION_FILE not found, aborting build.' - exit 1 -fi mkdir -p dist @@ -22,7 +16,7 @@ GO_VERSION=${GO_VERSION:-$(go version | awk '{print $3}')} GIT_COMMIT_HASH=${GIT_COMMIT_HASH:-$(git rev-parse --short HEAD)} # populate dependencies versions -DOCKER_VERSION=$(jq -r '.docker' < "${BINARY_VERSION_FILE}") +DOCKER_VERSION=$(go list -m -f '{{.Version}}' github.com/docker/docker) COMPOSE_VERSION=$(go list -m -f '{{.Version}}' github.com/docker/compose/v2) # Kubernetes SDK uses v0.x.y versioning, but official kubectl releases use v1.x.y # We need to transform the version (e.g., v0.33.2 -> v1.33.2) diff --git a/build/download_binaries.sh b/build/download_binaries.sh deleted file mode 100755 index 7054ec1d1d..0000000000 --- a/build/download_binaries.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -PLATFORM=${1:-"linux"} -ARCH=${2:-"amd64"} - -BINARY_VERSION_FILE="./binary-version.json" - -dockerVersion=$(jq -r '.docker' < "${BINARY_VERSION_FILE}") - -mkdir -p dist - -echo "Checking and downloading binaries for docker ${dockerVersion}" - -# Determine the binary file names based on the platform -dockerBinary="dist/docker" - -if [ "$PLATFORM" == "windows" ]; then - dockerBinary="dist/docker.exe" -fi - -# Check and download docker binary -if [ ! -f "$dockerBinary" ]; then - echo "Downloading docker binary..." - /usr/bin/env bash ./build/download_docker_binary.sh "$PLATFORM" "$ARCH" "$dockerVersion" -else - echo "Docker binary already exists, skipping download." -fi diff --git a/build/download_docker_binary.sh b/build/download_docker_binary.sh deleted file mode 100755 index eed8fcb317..0000000000 --- a/build/download_docker_binary.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -if [[ $# -ne 3 ]]; then - echo "Illegal number of parameters" >&2 - exit 1 -fi - -PLATFORM=$1 -ARCH=$2 -DOCKER_VERSION=${3:1} -DOWNLOAD_FOLDER=".tmp/download" - -if [[ ${PLATFORM} == "darwin" ]]; then - PLATFORM="mac" -fi - -if [[ ${ARCH} == "amd64" ]]; then - ARCH="x86_64" -elif [[ ${ARCH} == "arm" ]]; then - ARCH="armhf" -elif [[ ${ARCH} == "arm64" ]]; then - ARCH="aarch64" -elif [[ ${ARCH} == "ppc64le" ]]; then - DOCKER_VERSION="18.06.3-ce" -elif [[ ${ARCH} == "s390x" ]]; then - DOCKER_VERSION="18.06.3-ce" -fi - -rm -rf "${DOWNLOAD_FOLDER}" -mkdir -pv "${DOWNLOAD_FOLDER}" - -if [[ ${PLATFORM} == "windows" ]]; then - wget --tries=3 --waitretry=30 --quiet -O "${DOWNLOAD_FOLDER}/docker-binaries.zip" "https://download.docker.com/win/static/stable/${ARCH}/docker-${DOCKER_VERSION}.zip" - unzip "${DOWNLOAD_FOLDER}/docker-binaries.zip" -d "${DOWNLOAD_FOLDER}" - mv "${DOWNLOAD_FOLDER}/docker/docker.exe" dist/ -else - wget --tries=3 --waitretry=30 --quiet -O "${DOWNLOAD_FOLDER}/docker-binaries.tgz" "https://download.docker.com/${PLATFORM}/static/stable/${ARCH}/docker-${DOCKER_VERSION}.tgz" - tar -xf "${DOWNLOAD_FOLDER}/docker-binaries.tgz" -C "${DOWNLOAD_FOLDER}" - mv "${DOWNLOAD_FOLDER}/docker/docker" dist/ -fi diff --git a/build/linux/Dockerfile b/build/linux/Dockerfile index e96d2ad718..8efc1ebab4 100644 --- a/build/linux/Dockerfile +++ b/build/linux/Dockerfile @@ -10,7 +10,6 @@ LABEL org.opencontainers.image.title="Portainer" \ com.docker.extension.publisher-url="https://www.portainer.io" \ com.docker.extension.additional-urls="[{\"title\":\"Website\",\"url\":\"https://www.portainer.io?utm_campaign=DockerCon&utm_source=DockerDesktop\"},{\"title\":\"Documentation\",\"url\":\"https://docs.portainer.io\"},{\"title\":\"Support\",\"url\":\"https://join.slack.com/t/portainer/shared_invite/zt-txh3ljab-52QHTyjCqbe5RibC2lcjKA\"}]" -COPY dist/docker / COPY dist/mustache-templates /mustache-templates/ COPY dist/portainer / COPY dist/public /public/ diff --git a/build/linux/alpine.Dockerfile b/build/linux/alpine.Dockerfile index 9c42ed39d7..8f6bc7be48 100644 --- a/build/linux/alpine.Dockerfile +++ b/build/linux/alpine.Dockerfile @@ -10,7 +10,6 @@ LABEL org.opencontainers.image.title="Portainer" \ com.docker.extension.publisher-url="https://www.portainer.io" \ com.docker.extension.additional-urls="[{\"title\":\"Website\",\"url\":\"https://www.portainer.io?utm_campaign=DockerCon&utm_source=DockerDesktop\"},{\"title\":\"Documentation\",\"url\":\"https://docs.portainer.io\"},{\"title\":\"Support\",\"url\":\"https://join.slack.com/t/portainer/shared_invite/zt-txh3ljab-52QHTyjCqbe5RibC2lcjKA\"}]" -COPY dist/docker / COPY dist/mustache-templates /mustache-templates/ COPY dist/portainer / COPY dist/public /public/ diff --git a/build/windows/Dockerfile b/build/windows/Dockerfile index 131af7d154..abcae167d4 100644 --- a/build/windows/Dockerfile +++ b/build/windows/Dockerfile @@ -8,7 +8,6 @@ COPY --from=core /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll USER ContainerAdministrator -COPY dist/docker.exe / COPY dist/mustache-templates /mustache-templates/ COPY dist/portainer.exe / COPY dist/public /public/ @@ -32,4 +31,4 @@ LABEL git_commit=$GIT_COMMIT \ org.opencontainers.image.documentation="https://docs.portainer.io" \ io.portainer.server="true" -ENTRYPOINT ["/portainer.exe"] \ No newline at end of file +ENTRYPOINT ["/portainer.exe"] diff --git a/pkg/build/info.go b/pkg/build/info.go index e1a101e028..ecd38bd912 100644 --- a/pkg/build/info.go +++ b/pkg/build/info.go @@ -39,7 +39,7 @@ var ( // DepComposeVersion is the version of the Docker Compose plugin shipped with the application. DepComposeVersion string - // DepDockerVersion is the version of the Docker binary shipped with the application. + // DepDockerVersion is the version of the github.com/docker/docker Go module used by the application. DepDockerVersion string // DepKubectlVersion is the version of the Kubectl binary shipped with the application.