简体   繁体   English

无法为 docker 图像安装 docker 组合

[英]Unable to install docker compose for docker images

The docker compose part of the code in the foll. docker 构成以下代码的一部分。 docker file is throwing an error, it is not letting me install docker using the foll. docker 文件抛出错误,它不允许我使用以下方法安装 docker。 command命令

#Install Docker CLI
RUN curl -sSL https://get.docker.com/ | sh \
    && curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
    && chmod +x /usr/local/bin/docker-compose

Dockerfile Dockerfile

FROM debian:sid-slim

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive


#Versions
ENV HELM_VERSION=v3.10.0
ENV KUBECTL_VERSION=v1.20.9
ENV MAVEN_OPTS="-Djavax.net.ssl.trustStore=/cicd/assets/truststore.jks"
ENV TERRAFORM_VERSION=1.2.0
ENV GOLANG_VERSION=1.18.6
ENV TERRAGRUNT_VERSION=v0.38.7
 
RUN set -xe \
    && apt-get update -y \
    && apt-get install -y python3-pip

RUN apt-get install zip unzip
#Copy python requirements file
COPY requirements.txt /tmp/pip-tmp/
 
# Makes the Ansible directories
RUN mkdir /etc/ansible /ansible
RUN mkdir ~/.ssh



# Configure apt and install python packages
RUN apt-get update -y -q \
    && apt-get upgrade -y -q \
    && apt-get install -y wget \
    && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
    && apt-get install -y --no-install-recommends apt-utils \
    && apt-get -y install ca-certificates software-properties-common build-essential curl git gettext-base maven sshpass krb5-user \
    && pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
    && apt-get -y install jq \
    && rm -rf /tmp/pip-tmp 
 
#Install helm
RUN wget https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz \
&& tar -zxvf helm-${HELM_VERSION}-linux-amd64.tar.gz \
&& mv linux-amd64/helm /usr/local/bin/helm
 
#Install kubectl
RUN curl --silent https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl --output /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl
 
#Install Docker CLI
RUN curl -sSL https://get.docker.com/ | sh \
    && curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
    && chmod +x /usr/local/bin/docker-compose
 
#Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& ./aws/install

Error错误

linux-amd64/
linux-amd64/helm
linux-amd64/LICENSE
linux-amd64/README.md
Removing intermediate container 5e9e7dfad8e7
 ---> f973469c13ee
Step 16/33 : RUN curl --silent https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl --output /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl
 ---> Running in 291c7de9fa77
Removing intermediate container 291c7de9fa77
 ---> 189d6f646e42
Step 17/33 : RUN curl -sSL https://get.docker.com/ | sh     && curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose     && chmod +x /usr/local/bin/docker-compose
 ---> Running in e70582db8ec2
# Executing docker install script, commit: 4f282167c425347a931ccfd95cc91fab041d414f
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/debian/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
+ sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sh -c echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
E: The repository 'https://download.docker.com/linux/debian bookworm Release' does not have a Release file.
The command '/bin/sh -c curl -sSL https://get.docker.com/ | sh     && curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose     && chmod +x /usr/local/bin/docker-compose' returned a non-zero code: 100
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 100

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

BUILD FAILURE: Build step failure: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 100
ERROR: (gcloud.builds.submit) build 5da3c5d6-ee0c-4b70-abfd-25cd00202113 completed with status "FAILURE"

debian:sid-slim refers to bookworm , see next: debian:sid-slimbookworm ,见下:

$ docker run --rm -it debian:sid-slim cat /etc/issue
Debian GNU/Linux bookworm/sid \n \l

From the script of https://get.docker.com/ , you could see next:https://get.docker.com/的脚本中,您可以看到下一个:

case "$dist_version" in
    11)
        dist_version="bullseye"
    ;;
    10)
        dist_version="buster"
    ;;
    9)
        dist_version="stretch"
    ;;
    8)
        dist_version="jessie"
    ;;
esac

Above means that convenient script haven't supported the next unstable debian release.以上表示方便脚本不支持下一个不稳定的 debian 版本。

As a result, you may could try to install a docker cli from its prebuilt binaries , next is the exact link for the dockercli binary: https://download.docker.com/linux/static/stable/x86_64/因此,您可以尝试从其预构建的二进制文件中安装 docker cli ,接下来是 dockercli 二进制文件的确切链接: https://download.Z05B6053C41A2130AFD66_63B/statics/Ex.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM