From /

Revision as of 17:34, 30 April 2020 by Andre (talk | contribs) (Text replacement - "Section::Code Notes" to "Section::Code_Notes")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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

Persistent Storage with host Volumes

with local dir

sudo docker run --rm --name calculator_api -v /local/dir/:/persistent/dir/in/container  calculator_api:latest

with docker volume

sudo docker volume create volume_name
sudo docker volume ls 
sudo docker volume inspect volume_name
sudo ls /var/lib/docker/volumes/wiki_imgs/_data
build image
sudo docker run --rm --name calculator_api -v volume_name:/persistent/dir/in/container  calculator_api:latest

The persistent dir in the container will be mounted to a volume inside /var/lib/docker/volumes/

Other operations

Copy file from local system to docker container

sudo docker cp localfile continerid:/destination/of/file

Code_Notes 2020

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