Docker: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Overview ==


[https://docs.docker.com/engine/articles/systemd/ Control and configure Docker with systemd]
[https://docs.docker.com/engine/articles/systemd/ Control and configure Docker with systemd]


https://github.com/jpetazzo/nsenter
https://github.com/jpetazzo/nsenter


http://stackoverflow.com/questions/19234831/where-are-docker-images-stored-on-the-host-machine
http://stackoverflow.com/questions/19234831/where-are-docker-images-stored-on-the-host-machine
Line 12: Line 12:
https://docs.docker.com/engine/tutorials/dockerimages/
https://docs.docker.com/engine/tutorials/dockerimages/


https://docs.docker.com/get-started/part2/


== Quick ==
== Quick ==
list local images


  david@keres ~ $ docker images
  david@keres ~ $ docker images
Line 21: Line 24:
  david@keres ~ $
  david@keres ~ $


list images
start an image
 
docker start 7f09d45df511
starts detached
 
results in a "container"
 
run a container:
 
docker run
starts with stdin + stdout to you now ( attached , interactive )
 
list running instances


  docker ps
  docker ps
  docker ps -a
  docker ps -a
quick local elastic search:
docker run -d \
  -p 9200:9200 \
  -e "http.host=0.0.0.0" \
  -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
  -e "bootstrap_memory_lock=true" \
  --ulimit memlock=-1:-1 \
  -v ~/.data/:/usr/share/elasticsearch/data/ \
  --name ES \
  docker.elastic.co/elasticsearch/elasticsearch:5.4.1
== Maintenance and CLean up ==
sudo docker system prune -a -f
sudo docker rm -v $(sudo docker ps -a -q -f status=exited)
sudo docker rmi -f  $(sudo docker images -f "dangling=true" -q)
docker volume ls -qf dangling=true | xargs -r docker volume rm
== Public Registries ==
soem are btter htan others:
docker hub is the grandaddy https://hub.docker.com/
google has one with a half decent selection and interface: https://console.cloud.google.com/gcr/images/google-containers/GLOBAL
I defy you to find the aws one.
== Further reading ==
https://medium.com/@rohitkhatana/deploying-django-app-on-aws-ecs-using-docker-gunicorn-nginx-c90834f76e21
https://south.readthedocs.io/en/latest/installation.html
https://docs.djangoproject.com/en/2.0/intro/tutorial01/
https://docs.docker.com/compose/gettingstarted/#step-2-create-a-dockerfile
https://rominirani.com/docker-tutorial-series-part-6-docker-private-registry-15d1fd899255
== Also See ==
[[Kubernetes]]

Latest revision as of 20:12, 14 September 2020

Overview

Control and configure Docker with systemd

https://github.com/jpetazzo/nsenter

http://stackoverflow.com/questions/19234831/where-are-docker-images-stored-on-the-host-machine

https://docs.docker.com/engine/examples/mongodb/

https://docs.docker.com/engine/tutorials/dockerimages/

https://docs.docker.com/get-started/part2/

Quick

list local images

david@keres ~ $ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
mongo               latest              7f09d45df511        3 weeks ago         336.1 MB
centos              7                   61b442687d68        7 months ago        196.6 MB
david@keres ~ $

start an image

docker start 7f09d45df511
starts detached

results in a "container"

run a container:

docker run
starts with stdin + stdout to you now ( attached , interactive )

list running instances

docker ps
docker ps -a

quick local elastic search:

docker run -d \
 -p 9200:9200 \
 -e "http.host=0.0.0.0" \
 -e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
 -e "bootstrap_memory_lock=true" \
 --ulimit memlock=-1:-1 \
 -v ~/.data/:/usr/share/elasticsearch/data/ \
 --name ES \
 docker.elastic.co/elasticsearch/elasticsearch:5.4.1

Maintenance and CLean up

sudo docker system prune -a -f
sudo docker rm -v $(sudo docker ps -a -q -f status=exited)
sudo docker rmi -f  $(sudo docker images -f "dangling=true" -q)
docker volume ls -qf dangling=true | xargs -r docker volume rm

Public Registries

soem are btter htan others:

docker hub is the grandaddy https://hub.docker.com/

google has one with a half decent selection and interface: https://console.cloud.google.com/gcr/images/google-containers/GLOBAL

I defy you to find the aws one.

Further reading

https://medium.com/@rohitkhatana/deploying-django-app-on-aws-ecs-using-docker-gunicorn-nginx-c90834f76e21

https://south.readthedocs.io/en/latest/installation.html

https://docs.djangoproject.com/en/2.0/intro/tutorial01/

https://docs.docker.com/compose/gettingstarted/#step-2-create-a-dockerfile

https://rominirani.com/docker-tutorial-series-part-6-docker-private-registry-15d1fd899255

Also See

Kubernetes