----------------------------------------------------------------------------------
@MSGID: 2:5055/182.1 ec967dd9
@REPLY: 2:50/700.700 fb54c8c0
@PID: ХотДог/2.14.5/Android
@TID: jNode/Android
@CHRS: CP866 2
Hello, Oleg Nazaroff.
On 27.01.2026 00:45 you wrote:
ON> Ситуация такая: docker start my_cont запускает контейнер и все
как надо работает, но docker
ON> container ls не показывает никаких контейнеров, от слова
совсем. docker container inspect
ON> my_cont показывает адекватную контейнеру инфу, где рабочий
каталог где-то в
ON> /var/lib/docker/overlay2/.. объемом под 2 гига И мне хочется
этот самый контейнер восстановить
ON> и забэкапить.
https://www.baeldung.com/ops/docker-save-container-state
Docker allows us to create an image from a running container using
the docker commit command. This becomes useful if weve made changes
inside the container, such as installing packages or modifying
configurations.
2.1. The Command
The syntax of the command is:
docker commit
:
Where is the ID or name of the running
container, is the new name of the image, and is optional.
The generated image is the base image with an additional layer that
contains the current state of the container.
Its important to note that the docker commit command doesnt
capture everything. For example, the image wont include any mounted volumes
set up using the -v or mount options. This means that files stored in
those volumes arent part of the new image. Additionally, it doesnt save
container-specific settings such as network configurations, IP addresses, CPU and memory
limits, restart policies, or the working directory.
2.2. Example
Lets look at a practical example of how to save using commit.
Well start by running a container from the Ubuntu image:
$ docker run -it ubuntu /bin/bash
In this step, we must apply all the necessary modifications. In
this case, inside the running container, well only install the cURL
package:
# apt-get update && apt-get install -y curl
Once weve finished making changes, lets save the current state of
the container by creating a new image called ubuntu-with-curl:
$ docker commit 81f7bdcc6eff ubuntu-with-curl
sha256:52217d19f1b958a8a2f52f98644d187340cc363db0e22f499ac2469a68a5d78a
The hash value returned is the ID of our newly created image,
showing that the operation was successful. To confirm the changes made, we
can build a new container with the generated image and check the
version of cURL:
$ docker run -it ubuntu-with-curl /bin/bash
# curl --version
curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.13 zlib/1.3
brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.7)
libssh/0.10.6/openssl/zlib nghttp2/1.59.0 librtmp/2.3 OpenLDAP/2.6.7
Release-Date: 2023-12-06, security patched: 8.5.0-2ubuntu10.4
Protocols: dict file ftp ftps gopher gophers http https imap imaps
ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps
telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN
IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP
UnixSockets zstd
To facilitate the distribution of the image, we can use the docker
push command to upload it to a remote registry, such as Docker Hub.
ON> --
ON> WBR, ON --- ХотДог/2.14.5/Android * Origin: Somewhere at
Russia, in the hut on chicken
ON> legs... (2:50/700.700)
--
С наилучшими пожеланиями!
Опубликовано ХотДогом с планеты Ведроид
--- ХотДог/2.14.5/Android
* Origin: Android device, Milky Way (2:5055/182.1)
SEEN-BY: 46/49 50/109 104/117 221/1 6 240/1120
301/1 113 341/66 450/1024
SEEN-BY: 452/28 455/19 460/58 463/68 5000/111
5001/100 5010/352 5015/42 46
SEEN-BY: 5019/40 400 5020/101 113 545 620 715 830
846 848 1042 2992 4441
SEEN-BY: 5020/12000 5022/128 5030/49 115 500 1081
1474 1900 5050/151 5053/51
SEEN-BY: 5053/58 5054/89 5055/182 5058/104 5059/37
5060/900 5061/133 5083/1
SEEN-BY: 5083/444 6035/4 6078/80 6090/1
@PATH: 5055/182 301/1 5020/1042 4441