In the final steps of my Dockerfile I have this:
...more lines above
WORKDIR /home/app
RUN addgroup -S -g 10001 appGrp \
&& adduser -S -D -u 10000 -s /sbin/nologin -G appGrp app \
&& chown -R app:appGrp /home/app \
&& chmod -R 0777 /home/app
EXPOSE 8080
USER 10000:10001
ENTRYPOINT /home/app/docker/entrypoint.sh
What I see when is building the image in Jenkins is this output (an example, without all the repeated lines):
16:35:02 Step 33/36 : RUN addgroup -S -g 10001 appGrp && adduser -S -D -u 10000 -s /sbin/nologin -G appGrp app && chown -R app:appGrp /home/app && chmod -R 0777 /home/app
16:35:02 ---> Running in 4615db363bee
16:38:55 Removing intermediate container 4615db363bee
16:38:55 ---> e144d5271e1c
16:38:55 Step 34/36 : EXPOSE 8080
16:38:56 ---> Running in 5a8230fe76cb
16:38:56 Removing intermediate container 5a8230fe76cb
16:38:56 ---> 8f7d83d49dce
16:38:56 Step 35/36 : USER 10000:10001
16:38:56 ---> Running in 80ad0434fe0c
16:38:56 Removing intermediate container 80ad0434fe0c
16:38:56 ---> 1c406ae555b5
16:38:56 Step 36/36 : ENTRYPOINT /home/app/docker/entrypoint.sh
16:38:56 ---> Running in d19b395a5a74
16:38:56 Removing intermediate container d19b395a5a74
16:38:56 ---> 1364d8a7408d
16:38:56 [Warning] One or more build-args [kittBuildVersion] were not consumed
16:38:56 Successfully built 1364d8a7408d
16:38:56 Build done.
16:38:56 Adding additional tag 'docker.prod.XXX.com/XXXX-tech-chile/MYPROJECT-bff:latest'...
16:38:56 Added additional tag 'docker.prod.XXX.com/XXXX-tech-chile/MYPROJECT-bff:latest'.
16:38:56 Adding additional tag 'docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff:0.0.125'...
16:38:56 Added additional tag 'docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff:0.0.125'.
16:38:56 Pushing all tagged images...
16:38:56 Pushing 'docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff:latest'...
16:38:56 The push refers to repository [docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff]
16:38:56 c317fde342dc: Preparing
16:38:56 7d1a6e70fdfc: Waiting
// like 30 more lines about "Preparing"
16:38:56 9778b7897aea: Pushing current=1536,total=114078
16:38:57 9778b7897aea: Pushed
// Like 1000 more lines of "Pushing" and "Pushed"
16:40:02 latest: digest: sha256:123123 size: 3887
16:40:02 Pushed 'docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff:latest'.
16:40:02 Pushing 'docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff:0.0.125'...
16:40:02 The push refers to repository [docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff]
16:40:02 c317fde342dc: Preparing
// Like 20 more lines of "Preparing"
16:40:02 9961300779bc: Waiting
// Like 20 more lines of "Waiting"
16:40:02 c317fde342dc: Layer already exists
16:40:02 0455d2c29987: Layer already exists
16:40:02 a010dfb286c1: Layer already exists
// Like 15 more lines of "Layer already exists"
16:40:02 0.0.125: digest: sha256:ccd0cc9b715736c97c407f8567c2463b4f2dc525b5058b930a81ae9b8e30c09e size: 3887
16:40:02 Pushed 'docker.prod.XXXX.com/XXXX-tech-chile/MYPROJECT-bff:0.0.125'.
16:40:02 Running cleanup...
16:40:02 Removing built image docker.prod.XXXX.com/XXXX-tech-BBB/MYPROJECT-bff:latest
16:40:02 Removing built image docker.prod.XXXX.com/XXXX-tech-BBB/MYPROJECT-bff:0.0.125
16:40:17 Removing built image 1364d8a7408d
16:40:17 Docker engine: context disposing
16:40:17 Provenance proxy: docker session activities stored
16:40:17 Provenance proxy: docker session closed
What are those "Pushing", "Preparing" lines? why so much? I couldn't find much info on Docker docs about it.
CodePudding user response:
Preparing should be the conversation of the filesystem layer into a tar file and compressing. Pushing is uploading that tar file to the registry.
There are lots of lines in your output because:
- the progress is being shown on a new line instead of the tty style updating the line in place
- you have a lot of layers (judging by the 36 steps)
You can reduce the verbosity of docker push by using the -q
option.