Open JavaChr1s opened 6 years ago
me too!! no new image generate
Is there any chance for a reproducer? I don't see any errors in the log and Docker daemon even confirmed with status 200
that the image was uploaded, so I'm not sure what could be wrong here really.
packpage info:
[root@ssdnodes-56871 tmp]# pip install docker-squash
Collecting docker-squash
Downloading https://files.pythonhosted.org/packages/f4/df/5fec1436327ee8638754fad2eb60778d330fbb0a927856a894fa8916f754/docker-squash-1.0.7.tar.gz
Collecting docker (from docker-squash)
Using cached https://files.pythonhosted.org/packages/31/01/41f727a549abd788eb91d0df4c801cb4c1f5227eee04a2621e13d7ed3e04/docker-3.3.0-py2.py3-none-any.whl
Requirement already satisfied: six in /usr/lib/python2.7/site-packages (from docker-squash) (1.11.0)
Requirement already satisfied: backports.ssl-match-hostname>=3.5; python_version < "3.5" in /usr/lib/python2.7/site-packages (from docker->docker-squash) (3.5.0.1)
Requirement already satisfied: ipaddress>=1.0.16; python_version < "3.3" in /usr/lib/python2.7/site-packages (from docker->docker-squash) (1.0.16)
Requirement already satisfied: requests!=2.18.0,>=2.14.2 in /usr/lib/python2.7/site-packages (from docker->docker-squash) (2.18.4)
Collecting docker-pycreds>=0.2.3 (from docker->docker-squash)
Using cached https://files.pythonhosted.org/packages/ea/bf/7e70aeebc40407fbdb96fa9f79fc8e4722ea889a99378303e3bcc73f4ab5/docker_pycreds-0.3.0-py2.py3-none-any.whl
Requirement already satisfied: websocket-client>=0.32.0 in /usr/lib/python2.7/site-packages (from docker->docker-squash) (0.48.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.7/site-packages (from requests!=2.18.0,>=2.14.2->docker->docker-squash) (2018.4.16)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.7/site-packages (from requests!=2.18.0,>=2.14.2->docker->docker-squash) (3.0.4)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python2.7/site-packages (from requests!=2.18.0,>=2.14.2->docker->docker-squash) (2.6)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python2.7/site-packages (from requests!=2.18.0,>=2.14.2->docker->docker-squash) (1.22)
Installing collected packages: docker-pycreds, docker, docker-squash
Running setup.py install for docker-squash ... done
Successfully installed docker-3.3.0 docker-pycreds-0.3.0 docker-squash-1.0.7
docker images:
[root@ssdnodes-56871 tmp]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
test.register.top/pro-dev 6.3 6ca18b5aaad3 4 hours ago 1.94GB
mysql 5.7 0d16d0a97dd1 5 weeks ago 372MB
phusion/baseimage 0.10.1 2391dfad8777 2 months ago 241MB
memcached 1.4-alpine 273374b463b8 10 months ago 7.68MB
squash image: docker-squash -t test.register.top/pro-dev:latest test.register.top/pro-dev:6.3
result:
2018-06-12 02:09:24,169 root INFO docker-squash version 1.0.7, Docker 9ee9f40, API 1.37...
2018-06-12 02:09:24,169 root INFO Using v2 image format
2018-06-12 02:09:24,215 root INFO Old image has 27 layers
2018-06-12 02:09:24,215 root INFO Checking if squashing is necessary...
2018-06-12 02:09:24,215 root INFO Attempting to squash last 27 layers...
2018-06-12 02:09:24,215 root INFO Saving image sha256:6ca18b5aaad34fee2e97b2ab72dff123970575ab16d5de983d1be0eefeec80e9 to /tmp/docker-squash-YPBkoH/old directory...
2018-06-12 02:10:25,636 root INFO Image saved!
2018-06-12 02:10:25,639 root INFO Squashing image 'test.register.top/pro-dev:6.3'...
2018-06-12 02:10:25,642 root INFO Starting squashing...
2018-06-12 02:10:25,642 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/c532de99585ec025147d6715c41dec12d0d480df504fc31acaed70650aece3ca/layer.tar'...
2018-06-12 02:10:30,113 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/4d221e303987e22fd35da5d5980f2ebf1583976848e7bc145c901ba32d564f6c/layer.tar'...
2018-06-12 02:10:30,130 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/25aa5b971f8d95ea3613ec3a2f2a55a893fb54cbb021997b9d7dad891a68ca0e/layer.tar'...
2018-06-12 02:10:30,394 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/3c39ff67cb659e23fea0cd90053e03c34cea9416a833df694bac574574152627/layer.tar'...
2018-06-12 02:11:29,456 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/e9c2c03ddda42b3b34fe58416abea26142febda578bc9764c52c9f137f17e599/layer.tar'...
2018-06-12 02:12:24,126 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/8b5c7b226fcb09e57e761f7ea80021544234a0e91876c6d70e43ced80bcf7331/layer.tar'...
2018-06-12 02:12:30,212 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/065b4d9a33275ee4dc616bb5b396b82adc4807f8f93b61a517b05c60c63afcca/layer.tar'...
2018-06-12 02:12:30,425 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/bdef22b03b8e619e92a6a7ed78264cc21f0963159a3c9a50019e49de40699a81/layer.tar'...
2018-06-12 02:13:31,397 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/31d86c0b9ae1bca9dd53c6103491f657180203caf853fd437c2862a10663193b/layer.tar'...
2018-06-12 02:14:47,893 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/8fb842e9f1d61838b31970046eea0a8adba3fba7fe04f52f3a99a2347e231ce9/layer.tar'...
2018-06-12 02:14:47,908 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/eab0e71fa467972811d5054979f46f1c2109dddd5b0c8554e9314e953c87a3d7/layer.tar'...
2018-06-12 02:15:52,991 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/1f41713a8b383ed2848a893acecfd33440fa5b008701a47bfc90d770c2023457/layer.tar'...
2018-06-12 02:15:53,067 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/7e33e15285359e7abbd82a4fa1a47af87724037ed3373a7397f6d4ff29336177/layer.tar'...
2018-06-12 02:15:53,103 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/661636a9e9728bd482df6b184b3774e8264243075ebbd119d3ac5ccfe82e9a9e/layer.tar'...
2018-06-12 02:15:53,118 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/fc1f0c6602b110214956d5f5b02770f5230dc7a8a7e5e89548b9383e26761c99/layer.tar'...
2018-06-12 02:16:53,014 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/ff8a6345243e8702d2271f71b5fc345bdf9975f8e87356e98c45a79faa1b495a/layer.tar'...
2018-06-12 02:16:53,214 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/abed66127cd074508a5d2981e10a06d7cea4a8ecd394a575f7a170eddaf94696/layer.tar'...
2018-06-12 02:16:53,241 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/c9ac454dff2322d83c59eb33b3d56bbff3379f87eca544816352e5681a72dcbe/layer.tar'...
2018-06-12 02:16:53,264 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/4b1d73d52cae299239865d18d63530ade00b6da5c946ed4ecd97e6517fcf9bbf/layer.tar'...
2018-06-12 02:16:53,293 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/51bdeed2159207efff16227bcc47397bd799b4d96bd9145939a02570a5afcddd/layer.tar'...
2018-06-12 02:16:53,440 root INFO Squashing file '/tmp/docker-squash-YPBkoH/old/071e7d15fb17624a7b3aa6464e3b33e8cc6a5ff94af93b7303e95f2c2db9e395/layer.tar'...
2018-06-12 02:19:17,079 root INFO Squashing finished!
2018-06-12 02:19:24,756 root INFO Original image size: 1917.86 MB
2018-06-12 02:19:24,756 root INFO Squashed image size: 1824.89 MB
2018-06-12 02:19:24,756 root INFO Image size decreased by 4.85 %
2018-06-12 02:19:24,756 root INFO New squashed image ID is 377897c518dfe33594beda4cad73cdee28b37b59190cd9d8db869d13836403df
2018-06-12 02:19:41,147 root INFO Image registered in Docker daemon as test.register.top/pro-dev:latest
2018-06-12 02:19:41,184 root INFO Done
docker images:
[root@ssdnodes-56871 tmp]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
test.register.top/pro-dev 6.3 6ca18b5aaad3 4 hours ago 1.94GB
mysql 5.7 0d16d0a97dd1 5 weeks ago 372MB
phusion/baseimage 0.10.1 2391dfad8777 2 months ago 241MB
memcached 1.4-alpine 273374b463b8 10 months ago 7.68MB
This could be potentially related to some changes in Docker itself. What versions you use exactly and from where you got them? I assume this is Docker CE, version 18+. If that's the case, can you try to squash it using older Docker?
it's same for Docker version 17.12.1-ce
info:
2018-06-12 04:49:23,520 root INFO docker-squash version 1.0.7, Docker 7390fc6, API 1.35...
2018-06-12 04:49:23,521 root INFO Using v2 image format
2018-06-12 04:49:23,549 root INFO Old image has 27 layers
2018-06-12 04:49:23,549 root INFO Checking if squashing is necessary...
2018-06-12 04:49:23,549 root INFO Attempting to squash last 27 layers...
2018-06-12 04:49:23,549 root INFO Saving image sha256:bd7881d9b92487cfcf132c7e87cf52176c1685356abb3158e6234efce6530f21 to /tmp/docker-squash-a6BqHx/old directory...
2018-06-12 04:50:16,715 root INFO Image saved!
2018-06-12 04:50:16,717 root INFO Squashing image 'test.register.top/pro-dev:6.3'...
2018-06-12 04:50:16,773 root INFO Starting squashing...
2018-06-12 04:50:16,774 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/8039ff6548659a0b3ddfe754e342928cb0001ada7d5028524953eceb9f6d646e/layer.tar'...
2018-06-12 04:50:22,203 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/c8fdc245f00131845b0fc035b26ac31674ffe8129548968fd8af9073ea8cff86/layer.tar'...
2018-06-12 04:50:22,224 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/c126cb8b9014f4693d370ffe03a129cd11afda2a9ada55cee7c29ba31b84a9ad/layer.tar'...
2018-06-12 04:50:22,514 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/cbb01ea5b3ddb12369f26463b654371f4c893706fafe085755c504dd6729213e/layer.tar'...
2018-06-12 04:51:21,278 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/6aef58e77eb8585822b23c59931bf0785ffcef7b503c8969b5b9ffbe84033122/layer.tar'...
2018-06-12 04:52:13,210 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/7ed98a765fb01135fdaba627953e365e0fb64a39c8e2d4aa56b0d7adcb3d70ff/layer.tar'...
2018-06-12 04:52:18,597 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/c284fe43eaaa053bc622efc8294a6596c306b104b21e09506a750dc2d2fad2c9/layer.tar'...
2018-06-12 04:52:18,824 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/dec6bfdd10c284a58c3962601ae6bc0a1da0543dcd97baf979128093e81e12cd/layer.tar'...
2018-06-12 04:53:15,379 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/0512794037997b63ebc623d3e56b3c9a58017b9060f34d85a4f479b48152b2f8/layer.tar'...
2018-06-12 04:54:30,327 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/fa855a00aa2fdc8f51e786431cabcec4c41d7c03b7ce821a57b3c204b238988d/layer.tar'...
2018-06-12 04:54:30,341 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/b03683bee26b09e79fd9a775596d1043ae33ab5674f3f2f3e2204417700ab104/layer.tar'...
2018-06-12 04:55:30,894 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/aa46de52c48ff7f6850558ffb83e216c583e61cced8e1c7c76ed66fe33c56269/layer.tar'...
2018-06-12 04:55:30,972 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/5f0fb08eaf486d05bd63c1375619bcb9b759c76c7fb67fa1eecd96cb2eb62e4a/layer.tar'...
2018-06-12 04:55:31,023 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/1f8472fbe172e755e0630bafb53b45d45ca4ddae1ddf462c814ad7d01132f323/layer.tar'...
2018-06-12 04:55:31,036 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/fc1f0c6602b110214956d5f5b02770f5230dc7a8a7e5e89548b9383e26761c99/layer.tar'...
2018-06-12 04:56:28,680 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/ff8a6345243e8702d2271f71b5fc345bdf9975f8e87356e98c45a79faa1b495a/layer.tar'...
2018-06-12 04:56:28,848 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/abed66127cd074508a5d2981e10a06d7cea4a8ecd394a575f7a170eddaf94696/layer.tar'...
2018-06-12 04:56:28,870 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/c9ac454dff2322d83c59eb33b3d56bbff3379f87eca544816352e5681a72dcbe/layer.tar'...
2018-06-12 04:56:28,889 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/4b1d73d52cae299239865d18d63530ade00b6da5c946ed4ecd97e6517fcf9bbf/layer.tar'...
2018-06-12 04:56:28,915 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/51bdeed2159207efff16227bcc47397bd799b4d96bd9145939a02570a5afcddd/layer.tar'...
2018-06-12 04:56:29,049 root INFO Squashing file '/tmp/docker-squash-a6BqHx/old/071e7d15fb17624a7b3aa6464e3b33e8cc6a5ff94af93b7303e95f2c2db9e395/layer.tar'...
2018-06-12 04:58:48,668 root INFO Squashing finished!
2018-06-12 04:58:56,402 root INFO Original image size: 1917.82 MB
2018-06-12 04:58:56,403 root INFO Squashed image size: 1824.87 MB
2018-06-12 04:58:56,403 root INFO Image size decreased by 4.85 %
2018-06-12 04:58:56,403 root INFO New squashed image ID is 92aa8891d86b2097019d7915703227aa674898904ca68d20fbe8211a7fdf8665
2018-06-12 04:59:14,359 root INFO Image registered in Docker daemon as test.register.top/pro-dev:6.3-squash
2018-06-12 04:59:14,394 root INFO Done
[root@ssdnodes-56871 image]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
test.register.top/pro-dev 6.3 bd7881d9b924 34 minutes ago 1.94GB
phusion/baseimage 0.10.1 2391dfad8777 2 months ago 241MB
[root@ssdnodes-56871 image]# docker --version
Docker version 17.12.1-ce, build 7390fc6
Have you tried specifying the -f
flag? try to squash latest 3 or 5 layers. I wonder if it has anything to do with the fact that you squash all layers.
Generally speaking, squashing everything together can be viewed as a bad practice. Best practice is to squash everything that is part of the Dockerfile, leaving the image you base on, untouched.
I'm sorry for not replying immediately
emmm.
info:
[root@ssdnodes-56871 share]# docker-squash -f phusion/baseimage:0.10.1 -t test.register.top/pro-dev:test test.register.top/pro-dev:6.3
2018-06-12 11:32:10,600 root INFO docker-squash version 1.0.7, Docker 7390fc6, API 1.35...
2018-06-12 11:32:10,601 root INFO Using v2 image format
2018-06-12 11:32:10,618 root INFO Old image has 27 layers
2018-06-12 11:32:10,622 root INFO Checking if squashing is necessary...
2018-06-12 11:32:10,622 root INFO Attempting to squash last 16 layers...
2018-06-12 11:32:10,622 root INFO Saving image sha256:bd7881d9b92487cfcf132c7e87cf52176c1685356abb3158e6234efce6530f21 to /tmp/docker-squash-isY99l/old directory...
2018-06-12 11:33:04,025 root INFO Image saved!
2018-06-12 11:33:04,028 root INFO Squashing image 'test.register.top/pro-dev:6.3'...
2018-06-12 11:33:04,033 root INFO Starting squashing...
2018-06-12 11:33:05,146 root INFO Squashing file '/tmp/docker-squash-isY99l/old/8039ff6548659a0b3ddfe754e342928cb0001ada7d5028524953eceb9f6d646e/layer.tar'...
2018-06-12 11:33:10,206 root INFO Squashing file '/tmp/docker-squash-isY99l/old/c8fdc245f00131845b0fc035b26ac31674ffe8129548968fd8af9073ea8cff86/layer.tar'...
2018-06-12 11:33:10,220 root INFO Squashing file '/tmp/docker-squash-isY99l/old/c126cb8b9014f4693d370ffe03a129cd11afda2a9ada55cee7c29ba31b84a9ad/layer.tar'...
2018-06-12 11:33:10,585 root INFO Squashing file '/tmp/docker-squash-isY99l/old/cbb01ea5b3ddb12369f26463b654371f4c893706fafe085755c504dd6729213e/layer.tar'...
2018-06-12 11:34:04,831 root INFO Squashing file '/tmp/docker-squash-isY99l/old/6aef58e77eb8585822b23c59931bf0785ffcef7b503c8969b5b9ffbe84033122/layer.tar'...
2018-06-12 11:34:54,152 root INFO Squashing file '/tmp/docker-squash-isY99l/old/7ed98a765fb01135fdaba627953e365e0fb64a39c8e2d4aa56b0d7adcb3d70ff/layer.tar'...
2018-06-12 11:35:00,764 root INFO Squashing file '/tmp/docker-squash-isY99l/old/c284fe43eaaa053bc622efc8294a6596c306b104b21e09506a750dc2d2fad2c9/layer.tar'...
2018-06-12 11:35:01,029 root INFO Squashing file '/tmp/docker-squash-isY99l/old/dec6bfdd10c284a58c3962601ae6bc0a1da0543dcd97baf979128093e81e12cd/layer.tar'...
2018-06-12 11:35:57,556 root INFO Squashing file '/tmp/docker-squash-isY99l/old/0512794037997b63ebc623d3e56b3c9a58017b9060f34d85a4f479b48152b2f8/layer.tar'...
2018-06-12 11:37:17,709 root INFO Squashing file '/tmp/docker-squash-isY99l/old/fa855a00aa2fdc8f51e786431cabcec4c41d7c03b7ce821a57b3c204b238988d/layer.tar'...
2018-06-12 11:37:17,723 root INFO Squashing file '/tmp/docker-squash-isY99l/old/b03683bee26b09e79fd9a775596d1043ae33ab5674f3f2f3e2204417700ab104/layer.tar'...
2018-06-12 11:38:17,482 root INFO Squashing file '/tmp/docker-squash-isY99l/old/aa46de52c48ff7f6850558ffb83e216c583e61cced8e1c7c76ed66fe33c56269/layer.tar'...
2018-06-12 11:38:17,562 root INFO Squashing file '/tmp/docker-squash-isY99l/old/5f0fb08eaf486d05bd63c1375619bcb9b759c76c7fb67fa1eecd96cb2eb62e4a/layer.tar'...
2018-06-12 11:38:17,592 root INFO Squashing file '/tmp/docker-squash-isY99l/old/1f8472fbe172e755e0630bafb53b45d45ca4ddae1ddf462c814ad7d01132f323/layer.tar'...
2018-06-12 11:39:30,197 root INFO Squashing finished!
2018-06-12 11:39:37,838 root INFO Original image size: 1917.82 MB
2018-06-12 11:39:37,838 root INFO Squashed image size: 1892.39 MB
2018-06-12 11:39:37,838 root INFO Image size decreased by 1.33 %
2018-06-12 11:39:37,838 root INFO New squashed image ID is 056a5b8abb2819248722108d6e5a4b627d827732b3675f38b28afcba97e52eeb
2018-06-12 11:39:54,304 root INFO Image registered in Docker daemon as test.register.top/pro-dev:test
2018-06-12 11:39:54,348 root INFO Done
[root@ssdnodes-56871 share]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
test.register.top/pro-dev 6.3 bd7881d9b924 7 hours ago 1.94GB
phusion/baseimage 0.10.1 2391dfad8777 2 months ago 241MB
OK, I must admit that this is more than weird. Can you give me the last lines of the log, building with -v
after "New squashed image ID" line? I'm pretty sure the Docker API returns code 200
, otherwise we should have an exception thrown. And if it return 200 then it ACKs the image...
I was having this same issue until I have increased the sizes of the file systems that were holding both /tmp
and /var/lib/docker
. docker-squash
uses both locations. They were getting nearly full in my case, and the output image would not show up in docker images
, despite successful completion messages from docker-squash
. After growing both file systems, the problem resolved itself.
This is a very valuable finding worth investigation on my end. Thank you!
@zMingGit i have some issue,,what is your docker version??
I already used docker-squash a couple of times without any problem, but now the new images wasn't saved.
The image is used to be a oracle database. We do the following:
That worked for some versions, but now it stopped working. The squashed image is just not saved, but I can't see any error in the log.
osp@host01:~$ docker-squash -t osp-common-docker-local.artifacts.host.de/database:1.24.0 osp-common-docker-local.artifacts.host.de/database:1.24.0raw -v
(see the attached file for output) squash.log