Changes

Jump to navigation Jump to search
137 bytes added ,  14:39, 25 March 2019
m
no edit summary
Line 48: Line 48:  
=Restart stopped container with diferent command=
 
=Restart stopped container with diferent command=
 
Find your stopped container id
 
Find your stopped container id
docker ps -a
+
<source lang=bash>docker ps -a</source>
 
Commit the stopped container:
 
Commit the stopped container:
 
This command saves modified container state into a new image user/test_image
 
This command saves modified container state into a new image user/test_image
docker commit $CONTAINER_ID user/test_image
+
<source lang=bash>docker commit $CONTAINER_ID user/test_image</source>
 
Start/run with a different entry point:
 
Start/run with a different entry point:
docker run -ti --entrypoint=sh user/test_image
+
<source lang=bash>docker run -ti --entrypoint=sh user/test_image</source>
    
==Restart exited container==
 
==Restart exited container==
docker start  `docker ps -q -l` # restart it in the background
+
<source lang=bash>docker start  `docker ps -q -l` # restart it in the background
docker attach `docker ps -q -l` # reattach the terminal & stdin
+
docker attach `docker ps -q -l` # reattach the terminal & stdin</source>
    
==Create & Publish image==
 
==Create & Publish image==
mkdir rpi_python
+
<source lang=bash>mkdir rpi_python
nano rpi_python/Dockerfile
+
nano rpi_python/Dockerfile<source lang=bash>
    
Docekerfile
 
Docekerfile

Navigation menu