无法为docker映像安装docker compose



docker在下面的代码中组成一部分。docker文件抛出了一个错误,它不允许我使用foll安装docker。命令

#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

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

错误

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-slimbookworm,见下一页:

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

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

上面的意思是方便的脚本不支持下一个不稳定的debian版本。

因此,您可以尝试从其预构建的二进制文件中安装dockercli,下面是dockercli二进制文件的确切链接:https://download.docker.com/linux/static/stable/x86_64/

相关内容

  • 没有找到相关文章

最新更新