jenkinsci / docker-plugin

Jenkins cloud plugin that uses Docker
https://plugins.jenkins.io/docker-plugin/
MIT License
487 stars 322 forks source link

docker build too slow #1024

Open yuho8818 opened 9 months ago

yuho8818 commented 9 months ago

Jenkins and plugins versions report

HI, guys, I use the jenkins docker plugin build docker, but I found in the process of build, there are 5~10min I dont know what's going on.

What Operating System are you using (both controller, and any agents involved in the problem)?

my docker file is like: `FROM registry.cn-hangzhou.aliyuncs.com/aliyun-cnp/code_contest:base-image

ARG VERSION ENV VERSION $VERSION ARG BUILD_TIMESTAMP ENV BUILD_TIMESTAMP $BUILD_TIMESTAMP

WORKDIR /cnp-workspace

COPY ./models /cnp-workspace/models COPY ./cnp-framework /cnp-workspace/cnp-framework RUN pip install -r /cnp-workspace/models/requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com `

Reproduction steps

I use the remote docker machine to build the docker. I use the configure clouds add a ecs for build my docker.

Expected Results

none

Actual Results

my build log likes this 15:03:20 Docker Build 15:03:20 Docker Build: building image at path /var/jenkins_home/workspace/NGC_23.07_Docker_Build 15:12:11 Step 1/12 : ARG NGC_VERSION 15:12:11 15:12:11 15:12:11 Step 2/12 : FROM nvcr.io/nvidia/pytorch:${NGC_VERSION}-py3 15:12:11 15:12:11 15:12:11 ---> bd784c42fdf0 15:12:11 15:12:11 Step 3/12 : ENV NGC_VERSION $NGC_VERSION 15:12:11 15:12:11 15:12:11 ---> Using cache 15:12:11 15:12:11 ---> 7a6d341aba17 15:12:11 15:12:11 Step 4/12 : ARG VERSION 15:12:11 15:12:11 15:12:11 ---> Using cache 15:12:11 15:12:11 ---> ca994095a0c0 15:12:11 15:12:11 Step 5/12 : ENV VERSION $VERSION 15:12:11 15:12:11 15:12:11 ---> Using cache 15:12:11 15:12:11 ---> 77cffb5c8f7e 15:12:11 15:12:11 Step 6/12 : ARG BUILD_TIMESTAMP 15:12:11 15:12:11 15:12:11 ---> Using cache 15:12:11 15:12:11 ---> 6436bae33253 15:12:11 15:12:11 Step 7/12 : ENV BUILD_TIMESTAMP $BUILD_TIMESTAMP 15:12:11 15:12:11 15:12:11 ---> Using cache 15:12:11 15:12:11 ---> b100a560644d 15:12:11 15:12:11 Step 8/12 : WORKDIR /cnp-workspace 15:12:11 15:12:11 15:12:11 ---> Using cache 15:12:11 15:12:11 ---> 9a4b68e23a89 15:12:11 15:12:11 Step 9/12 : COPY ./models/llama /cnp-workspace/models/llama 15:12:11 15:12:11 15:12:12 ---> Using cache 15:12:12 15:12:12 ---> b619cb9c577d 15:12:12 15:12:12 Step 10/12 : COPY ./cnp-framework /cnp-workspace/cnp-framework 15:12:12 15:12:12 15:12:12 ---> Using cache 15:12:12 15:12:12 ---> e9f342ae96f3 15:12:12 15:12:12 Step 11/12 : RUN pip install -r /cnp-workspace/models/llama/requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com 15:12:12 15:12:12 15:12:12 ---> Using cache 15:12:12 15:12:12 ---> faa6162a3f93 15:12:12 15:12:12 Step 12/12 : RUN mkdir -p /bin && wget http://gosspublic.alicdn.com/ossutil/1.7.7/ossutil64 -O /bin/ossutil64 && chmod +x /bin/ossutil64 15:12:12 15:12:12 15:12:12 ---> Using cache 15:12:12 15:12:12 ---> 18abb2e53815 15:12:12 15:12:12 Successfully built 18abb2e53815 15:12:12 15:12:12 Tagging built image with registry.cn-wulanchabu.aliyuncs.com/aliyun-cnp/llama:cnp1.0-ba568518-ngc23.07-py3.10-cuda12.1-torch2.1.0-nccl2.18.3 15:12:12 Docker Build Response : 18abb2e53815 15:12:12 Pushing [registry.cn-wulanchabu.aliyuncs.com/aliyun-cnp/llama:cnp1.0-ba568518-ngc23.07-py3.10-cuda12.1-torch2.1.0-nccl2.18.3] 15:12:13 The push refers to repository [registry.cn-wulanchabu.aliyuncs.com/aliyun-cnp/llama] 15:12:13 148a91207718: Preparing 15:12:13 f47311963a9f: Preparing 15:12:13 bb77bd5f5d0b: Preparing 15:12:13 caf88b99a090: Preparing 15:12:13 606971fd76e9: Preparing 15:12:13 d1e7a8c4e760: Preparing 15:12:13 30c7394624c2: Preparing 15:12:13 178548f8a426: Preparing 15:12:13 b65ae4ab8dc7: Preparing 15:12:13 636b61f252d2: Preparing 15:12:13 920cedefb8a6: Preparing 15:12:13 b3e4291b73c0: Preparing 15:12:13 b65ae4ab8dc7: Waiting 15:12:13 5783fc7b8c0b: Preparing 15:12:13 178548f8a426: Waiting 15:12:13 1e69ccaf4e15: Preparing 15:12:13 636b61f252d2: Waiting 15:12:13 920cedefb8a6: Waiting 15:12:13 b3e4291b73c0: Waiting 15:12:13 d1e7a8c4e760: Waiting 15:12:13 7341cff9f20c: Preparing 15:12:13 30c7394624c2: Waiting 15:12:13 1e69ccaf4e15: Waiting 15:12:13 5783fc7b8c0b: Waiting 15:12:13 f0704df7187a: Preparing 15:12:13 dc1f7269f5f8: Preparing 15:12:13 7341cff9f20c: Waiting 15:12:13 f0704df7187a: Waiting 15:12:13 5f70bf18a086: Preparing 15:12:13 c70dfc325b8e: Preparing 15:12:13 dde3dc494ce1: Preparing 15:12:13 03f682ddd7d9: Preparing 15:12:13 c70dfc325b8e: Waiting 15:12:13 dc1f7269f5f8: Waiting 15:12:13 5f70bf18a086: Waiting 15:12:13 205824650b32: Preparing 15:12:13 d310f2385a6a: Preparing 15:12:13 dde3dc494ce1: Waiting 15:12:13 a44e188555f3: Preparing 15:12:13 205824650b32: Waiting 15:12:13 699b371eb293: Preparing 15:12:13 d310f2385a6a: Waiting 15:12:13 a44e188555f3: Waiting 15:12:13 a72ddb05bbbb: Preparing 15:12:13 750115b627d3: Preparing 15:12:13 a72ddb05bbbb: Waiting 15:12:13 dc48c8002142: Preparing 15:12:13 699b371eb293: Waiting 15:12:13 750115b627d3: Waiting 15:12:13 7d16279a3c76: Preparing 15:12:13 bcd59521289e: Preparing 15:12:13 dc48c8002142: Waiting 15:12:13 981bef24125c: Preparing

Anything else?

I dont konw what's happen between 15:03:20 and 15:12:11. It takes almost 9 min to do something, It's too long for me. Can any body give me some advice or answer?