Actions

Difference between revisions of "Docker"

From /oooooooooo.io/

Line 1: Line 1:
explore a docker image:
+
build
  
sudo docker run --rm -it --entrypoint=/bin/sh  calculatorapi:latest  
+
<code>sudo docker build -t calculator_api:latest .</code>
  
 +
Load image file into local docker images repository
  
explore a running docker container:
+
<code>sudo docker load -i calculator_api.tar</code>
  
  docker exec -it name-of-container sh
+
Run container
 +
 
 +
<code>sudo docker run --rm -p 6543:6543 --name calculator_api calculator_api:latest</code>
 +
 
 +
Enter running container
 +
 
 +
<code>sudo docker run --rm -it --entrypoint=/bin/sh  calculator_api:latest</code>
 +
 
 +
save to image
 +
 
 +
<code>sudo docker save calculator_api:latest | gzip &gt; calculator_api.tar.gz</code>
 +
 
 +
Shutdown the docker container gracefully:
 +
 
 +
<code>sudo docker stop calculator_api</code>
  
  

Revision as of 21:56, 17 February 2020

build

sudo docker build -t calculator_api:latest .

Load image file into local docker images repository

sudo docker load -i calculator_api.tar

Run container

sudo docker run --rm -p 6543:6543 --name calculator_api calculator_api:latest

Enter running container

sudo docker run --rm -it --entrypoint=/bin/sh calculator_api:latest

save to image

sudo docker save calculator_api:latest | gzip > calculator_api.tar.gz

Shutdown the docker container gracefully:

sudo docker stop calculator_api


Code Notes 2018

... more about "Docker"
Code Notes +
Date"Date" is a type and predefined property provided by Semantic MediaWiki to represent date values.
2018 +