為 gitlab runner 基礎鏡像構建 docker 鏡像時,出現以下錯誤:
ERRO[2021-12-29T09:46:32Z] Application execution failed PID=6622 error="executing the script on the remote host: executing script on container with IP \"3.x.x.x\": connecting to server: connecting to server \"3.x.x.x:x\" as user \"root\": dial tcp 3.x.x.x:x: connect: connection refused"
ERROR: Job failed (system failure): prepare environment: exit status 2. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
Dockerfile:
FROM registry.gitlab.com/tmaczukin-test-projects/fargate-driver-debian:latest
RUN apt-get install -y wget && \
apt-get install -y python3-pip && \
wget https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip && \
unzip terraform_0.12.24_linux_amd64.zip
mv terraform /usr/local/bin && \
chmod -R 777 /usr/local/bin
uj5u.com熱心網友回復:
我假設標題中提到的錯誤來自apt-get install命令。您應該首先運行apt-get update以獲取更新的軟體包串列。否則 apt 將從陳舊狀態中尋找包(無論何時創建基本映像)。您還可以合并安裝命令并在同一步驟中包括清理臨時檔案以減小層大小。
FROM registry.gitlab.com/tmaczukin-test-projects/fargate-driver-debian:latest
RUN apt-get update && \
apt-get install -y \
python3-pip \
wget && \
wget https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zip && \
unzip terraform_0.12.24_linux_amd64.zip
mv terraform /usr/local/bin && \
chmod -R 777 /usr/local/bin && \
rm terraform_0.12.24_linux_amd64.zip && \
rm -rf /var/lib/apt/lists/*
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/397896.html
標籤:码头工人 GitLab 文件 gitlab-ci-runner 西德
上一篇:GooglePlaceApieroor-提供的API密鑰無效
下一篇:谷歌云部署容器虛擬機“命令”選項
