Can't run docker commit, not enough space
So I'm fairly new to docker and still trying to understand some of the basic things. At the moment, I have two docker images:
[root:kali:~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kalilinux/kali-linux-docker latest 5e4d6c84829d About an hour ago 9.57GB
kalilinux/kali-linux-docker <none> f26f3ae90aee 2 months ago 1.57GB
For whatever reason, the first one with the latest
tag is a child of the other one. Assuming the one with the latest
tag is a container that I committed changes to.
However, now I'm trying to commit/save changes to this image, but I'm getting the following error:
Error response from daemon: Error processing tar file(exit status 1):
write /usr/lib/x86_64-linux-gnu/libclang-7.so.1: no space left on
device
I checked my disk space, and it looks like I have 4GB available:
[root:kali:~]# df -h
Filesystem Size Used Avail Use% Mounted on
udev 481M 0 481M 0% /dev
tmpfs 99M 944K 98M 1% /run
/dev/vda1 25G 20G 4.1G 83% /
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/vda15 105M 3.6M 101M 4% /boot/efi
/dev/loop0 88M 88M 0 100% /snap/core/5662
/dev/loop1 67M 67M 0 100% /snap/lxd/9239
tmpfs 99M 0 99M 0% /run/user/0
overlay 25G 20G 4.1G 83% /var/lib/docker/overlay2/b2178e65852a017f21124a23d63e32a66faaa8b8375429865e8433da9fc0db20/merged
shm 64M 0 64M 0% /var/lib/docker/containers/af2d2ed99d91d2247f550a23af988ce4a624e186ac80782046f0868418547d3d/mounts/shm
/dev/loop2 90M 90M 0 100% /snap/core/6130
/dev/loop3 52M 52M 0 100% /snap/lxd/9795
So here are my questions:
- Is there any way that I can merge my two images so that I don't end up with a bunch of child images?
- Is the
docker commit
command actually trying to make a copy of the container? Or is it just simply saving it? My reason for this question is because I only have 4GB remaining, but yet I have the image exactly how I want it, so why can't it just save? Is it going to need an extra 9GB of space every time I run commit?
Trying to avoid having to shut down the VPS and increase its disk space if I can help it.
Thanks for any help.
docker
add a comment |
So I'm fairly new to docker and still trying to understand some of the basic things. At the moment, I have two docker images:
[root:kali:~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kalilinux/kali-linux-docker latest 5e4d6c84829d About an hour ago 9.57GB
kalilinux/kali-linux-docker <none> f26f3ae90aee 2 months ago 1.57GB
For whatever reason, the first one with the latest
tag is a child of the other one. Assuming the one with the latest
tag is a container that I committed changes to.
However, now I'm trying to commit/save changes to this image, but I'm getting the following error:
Error response from daemon: Error processing tar file(exit status 1):
write /usr/lib/x86_64-linux-gnu/libclang-7.so.1: no space left on
device
I checked my disk space, and it looks like I have 4GB available:
[root:kali:~]# df -h
Filesystem Size Used Avail Use% Mounted on
udev 481M 0 481M 0% /dev
tmpfs 99M 944K 98M 1% /run
/dev/vda1 25G 20G 4.1G 83% /
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/vda15 105M 3.6M 101M 4% /boot/efi
/dev/loop0 88M 88M 0 100% /snap/core/5662
/dev/loop1 67M 67M 0 100% /snap/lxd/9239
tmpfs 99M 0 99M 0% /run/user/0
overlay 25G 20G 4.1G 83% /var/lib/docker/overlay2/b2178e65852a017f21124a23d63e32a66faaa8b8375429865e8433da9fc0db20/merged
shm 64M 0 64M 0% /var/lib/docker/containers/af2d2ed99d91d2247f550a23af988ce4a624e186ac80782046f0868418547d3d/mounts/shm
/dev/loop2 90M 90M 0 100% /snap/core/6130
/dev/loop3 52M 52M 0 100% /snap/lxd/9795
So here are my questions:
- Is there any way that I can merge my two images so that I don't end up with a bunch of child images?
- Is the
docker commit
command actually trying to make a copy of the container? Or is it just simply saving it? My reason for this question is because I only have 4GB remaining, but yet I have the image exactly how I want it, so why can't it just save? Is it going to need an extra 9GB of space every time I run commit?
Trying to avoid having to shut down the VPS and increase its disk space if I can help it.
Thanks for any help.
docker
Hypothetically, what if you did need to recreate your VPS? You'd wish you had written down the steps to build your image in a text file and committed that listing to source control; but that's exactly aDockerfile
that gets fed into the standarddocker build
sequence. Runningdocker commit
is almost never a best practice.
– David Maze
Jan 2 at 0:35
Ahh ok, I see what you're saying. So technically I should just build the image every time I need to run Kali (which wouldn't be a biggie since I'm just installing random stuff).
– LewlSauce
Jan 2 at 0:36
add a comment |
So I'm fairly new to docker and still trying to understand some of the basic things. At the moment, I have two docker images:
[root:kali:~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kalilinux/kali-linux-docker latest 5e4d6c84829d About an hour ago 9.57GB
kalilinux/kali-linux-docker <none> f26f3ae90aee 2 months ago 1.57GB
For whatever reason, the first one with the latest
tag is a child of the other one. Assuming the one with the latest
tag is a container that I committed changes to.
However, now I'm trying to commit/save changes to this image, but I'm getting the following error:
Error response from daemon: Error processing tar file(exit status 1):
write /usr/lib/x86_64-linux-gnu/libclang-7.so.1: no space left on
device
I checked my disk space, and it looks like I have 4GB available:
[root:kali:~]# df -h
Filesystem Size Used Avail Use% Mounted on
udev 481M 0 481M 0% /dev
tmpfs 99M 944K 98M 1% /run
/dev/vda1 25G 20G 4.1G 83% /
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/vda15 105M 3.6M 101M 4% /boot/efi
/dev/loop0 88M 88M 0 100% /snap/core/5662
/dev/loop1 67M 67M 0 100% /snap/lxd/9239
tmpfs 99M 0 99M 0% /run/user/0
overlay 25G 20G 4.1G 83% /var/lib/docker/overlay2/b2178e65852a017f21124a23d63e32a66faaa8b8375429865e8433da9fc0db20/merged
shm 64M 0 64M 0% /var/lib/docker/containers/af2d2ed99d91d2247f550a23af988ce4a624e186ac80782046f0868418547d3d/mounts/shm
/dev/loop2 90M 90M 0 100% /snap/core/6130
/dev/loop3 52M 52M 0 100% /snap/lxd/9795
So here are my questions:
- Is there any way that I can merge my two images so that I don't end up with a bunch of child images?
- Is the
docker commit
command actually trying to make a copy of the container? Or is it just simply saving it? My reason for this question is because I only have 4GB remaining, but yet I have the image exactly how I want it, so why can't it just save? Is it going to need an extra 9GB of space every time I run commit?
Trying to avoid having to shut down the VPS and increase its disk space if I can help it.
Thanks for any help.
docker
So I'm fairly new to docker and still trying to understand some of the basic things. At the moment, I have two docker images:
[root:kali:~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kalilinux/kali-linux-docker latest 5e4d6c84829d About an hour ago 9.57GB
kalilinux/kali-linux-docker <none> f26f3ae90aee 2 months ago 1.57GB
For whatever reason, the first one with the latest
tag is a child of the other one. Assuming the one with the latest
tag is a container that I committed changes to.
However, now I'm trying to commit/save changes to this image, but I'm getting the following error:
Error response from daemon: Error processing tar file(exit status 1):
write /usr/lib/x86_64-linux-gnu/libclang-7.so.1: no space left on
device
I checked my disk space, and it looks like I have 4GB available:
[root:kali:~]# df -h
Filesystem Size Used Avail Use% Mounted on
udev 481M 0 481M 0% /dev
tmpfs 99M 944K 98M 1% /run
/dev/vda1 25G 20G 4.1G 83% /
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/vda15 105M 3.6M 101M 4% /boot/efi
/dev/loop0 88M 88M 0 100% /snap/core/5662
/dev/loop1 67M 67M 0 100% /snap/lxd/9239
tmpfs 99M 0 99M 0% /run/user/0
overlay 25G 20G 4.1G 83% /var/lib/docker/overlay2/b2178e65852a017f21124a23d63e32a66faaa8b8375429865e8433da9fc0db20/merged
shm 64M 0 64M 0% /var/lib/docker/containers/af2d2ed99d91d2247f550a23af988ce4a624e186ac80782046f0868418547d3d/mounts/shm
/dev/loop2 90M 90M 0 100% /snap/core/6130
/dev/loop3 52M 52M 0 100% /snap/lxd/9795
So here are my questions:
- Is there any way that I can merge my two images so that I don't end up with a bunch of child images?
- Is the
docker commit
command actually trying to make a copy of the container? Or is it just simply saving it? My reason for this question is because I only have 4GB remaining, but yet I have the image exactly how I want it, so why can't it just save? Is it going to need an extra 9GB of space every time I run commit?
Trying to avoid having to shut down the VPS and increase its disk space if I can help it.
Thanks for any help.
docker
docker
asked Jan 1 at 22:40
LewlSauceLewlSauce
1,07611225
1,07611225
Hypothetically, what if you did need to recreate your VPS? You'd wish you had written down the steps to build your image in a text file and committed that listing to source control; but that's exactly aDockerfile
that gets fed into the standarddocker build
sequence. Runningdocker commit
is almost never a best practice.
– David Maze
Jan 2 at 0:35
Ahh ok, I see what you're saying. So technically I should just build the image every time I need to run Kali (which wouldn't be a biggie since I'm just installing random stuff).
– LewlSauce
Jan 2 at 0:36
add a comment |
Hypothetically, what if you did need to recreate your VPS? You'd wish you had written down the steps to build your image in a text file and committed that listing to source control; but that's exactly aDockerfile
that gets fed into the standarddocker build
sequence. Runningdocker commit
is almost never a best practice.
– David Maze
Jan 2 at 0:35
Ahh ok, I see what you're saying. So technically I should just build the image every time I need to run Kali (which wouldn't be a biggie since I'm just installing random stuff).
– LewlSauce
Jan 2 at 0:36
Hypothetically, what if you did need to recreate your VPS? You'd wish you had written down the steps to build your image in a text file and committed that listing to source control; but that's exactly a
Dockerfile
that gets fed into the standard docker build
sequence. Running docker commit
is almost never a best practice.– David Maze
Jan 2 at 0:35
Hypothetically, what if you did need to recreate your VPS? You'd wish you had written down the steps to build your image in a text file and committed that listing to source control; but that's exactly a
Dockerfile
that gets fed into the standard docker build
sequence. Running docker commit
is almost never a best practice.– David Maze
Jan 2 at 0:35
Ahh ok, I see what you're saying. So technically I should just build the image every time I need to run Kali (which wouldn't be a biggie since I'm just installing random stuff).
– LewlSauce
Jan 2 at 0:36
Ahh ok, I see what you're saying. So technically I should just build the image every time I need to run Kali (which wouldn't be a biggie since I'm just installing random stuff).
– LewlSauce
Jan 2 at 0:36
add a comment |
1 Answer
1
active
oldest
votes
As far as I know, there is no way to merge images, but deleting them is possible.
With every commit you increase the size of your image. You can have a look into the layers of an image and their size with:
docker history <image name>
Instead of working with the old images you could use a Dockerfile and build the image you want to use from scratch. Building sometimes takes a longer time, but you should find a way to build the images in an automated way to be able to repeat them for production usage. If you build the images from scratch, and use some verified images you'll get the new patched version for free. Within a Dockerfile you can have a maximum of 125 layers, which means you should use as less RUN commands as possible and chain them with linux/unix notation e.g.
RUN apt-get update -y && apt-get install -y
ansible
openssh-client
vim
wget
https://docs.docker.com/engine/reference/builder/
https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
When you run thecommit
command, does it copy the whole image into another image? So if I have a 9GB image and run commit, why exactly do I get a "no disk space" error with 4GB of free space?
– LewlSauce
Jan 2 at 0:23
docs.docker.com/engine/reference/commandline/commit In the description you can find "Create a new image from a container’s changes"
– user934801
Jan 2 at 0:29
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999508%2fcant-run-docker-commit-not-enough-space%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As far as I know, there is no way to merge images, but deleting them is possible.
With every commit you increase the size of your image. You can have a look into the layers of an image and their size with:
docker history <image name>
Instead of working with the old images you could use a Dockerfile and build the image you want to use from scratch. Building sometimes takes a longer time, but you should find a way to build the images in an automated way to be able to repeat them for production usage. If you build the images from scratch, and use some verified images you'll get the new patched version for free. Within a Dockerfile you can have a maximum of 125 layers, which means you should use as less RUN commands as possible and chain them with linux/unix notation e.g.
RUN apt-get update -y && apt-get install -y
ansible
openssh-client
vim
wget
https://docs.docker.com/engine/reference/builder/
https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
When you run thecommit
command, does it copy the whole image into another image? So if I have a 9GB image and run commit, why exactly do I get a "no disk space" error with 4GB of free space?
– LewlSauce
Jan 2 at 0:23
docs.docker.com/engine/reference/commandline/commit In the description you can find "Create a new image from a container’s changes"
– user934801
Jan 2 at 0:29
add a comment |
As far as I know, there is no way to merge images, but deleting them is possible.
With every commit you increase the size of your image. You can have a look into the layers of an image and their size with:
docker history <image name>
Instead of working with the old images you could use a Dockerfile and build the image you want to use from scratch. Building sometimes takes a longer time, but you should find a way to build the images in an automated way to be able to repeat them for production usage. If you build the images from scratch, and use some verified images you'll get the new patched version for free. Within a Dockerfile you can have a maximum of 125 layers, which means you should use as less RUN commands as possible and chain them with linux/unix notation e.g.
RUN apt-get update -y && apt-get install -y
ansible
openssh-client
vim
wget
https://docs.docker.com/engine/reference/builder/
https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
When you run thecommit
command, does it copy the whole image into another image? So if I have a 9GB image and run commit, why exactly do I get a "no disk space" error with 4GB of free space?
– LewlSauce
Jan 2 at 0:23
docs.docker.com/engine/reference/commandline/commit In the description you can find "Create a new image from a container’s changes"
– user934801
Jan 2 at 0:29
add a comment |
As far as I know, there is no way to merge images, but deleting them is possible.
With every commit you increase the size of your image. You can have a look into the layers of an image and their size with:
docker history <image name>
Instead of working with the old images you could use a Dockerfile and build the image you want to use from scratch. Building sometimes takes a longer time, but you should find a way to build the images in an automated way to be able to repeat them for production usage. If you build the images from scratch, and use some verified images you'll get the new patched version for free. Within a Dockerfile you can have a maximum of 125 layers, which means you should use as less RUN commands as possible and chain them with linux/unix notation e.g.
RUN apt-get update -y && apt-get install -y
ansible
openssh-client
vim
wget
https://docs.docker.com/engine/reference/builder/
https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
As far as I know, there is no way to merge images, but deleting them is possible.
With every commit you increase the size of your image. You can have a look into the layers of an image and their size with:
docker history <image name>
Instead of working with the old images you could use a Dockerfile and build the image you want to use from scratch. Building sometimes takes a longer time, but you should find a way to build the images in an automated way to be able to repeat them for production usage. If you build the images from scratch, and use some verified images you'll get the new patched version for free. Within a Dockerfile you can have a maximum of 125 layers, which means you should use as less RUN commands as possible and chain them with linux/unix notation e.g.
RUN apt-get update -y && apt-get install -y
ansible
openssh-client
vim
wget
https://docs.docker.com/engine/reference/builder/
https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
answered Jan 2 at 0:14
user934801user934801
84411028
84411028
When you run thecommit
command, does it copy the whole image into another image? So if I have a 9GB image and run commit, why exactly do I get a "no disk space" error with 4GB of free space?
– LewlSauce
Jan 2 at 0:23
docs.docker.com/engine/reference/commandline/commit In the description you can find "Create a new image from a container’s changes"
– user934801
Jan 2 at 0:29
add a comment |
When you run thecommit
command, does it copy the whole image into another image? So if I have a 9GB image and run commit, why exactly do I get a "no disk space" error with 4GB of free space?
– LewlSauce
Jan 2 at 0:23
docs.docker.com/engine/reference/commandline/commit In the description you can find "Create a new image from a container’s changes"
– user934801
Jan 2 at 0:29
When you run the
commit
command, does it copy the whole image into another image? So if I have a 9GB image and run commit, why exactly do I get a "no disk space" error with 4GB of free space?– LewlSauce
Jan 2 at 0:23
When you run the
commit
command, does it copy the whole image into another image? So if I have a 9GB image and run commit, why exactly do I get a "no disk space" error with 4GB of free space?– LewlSauce
Jan 2 at 0:23
docs.docker.com/engine/reference/commandline/commit In the description you can find "Create a new image from a container’s changes"
– user934801
Jan 2 at 0:29
docs.docker.com/engine/reference/commandline/commit In the description you can find "Create a new image from a container’s changes"
– user934801
Jan 2 at 0:29
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999508%2fcant-run-docker-commit-not-enough-space%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hypothetically, what if you did need to recreate your VPS? You'd wish you had written down the steps to build your image in a text file and committed that listing to source control; but that's exactly a
Dockerfile
that gets fed into the standarddocker build
sequence. Runningdocker commit
is almost never a best practice.– David Maze
Jan 2 at 0:35
Ahh ok, I see what you're saying. So technically I should just build the image every time I need to run Kali (which wouldn't be a biggie since I'm just installing random stuff).
– LewlSauce
Jan 2 at 0:36