【WIP】get started to docker

创建: 2022/8/2

 

Introduction to Docker
   
   
   
   
   

Docker Basics and Common Commands

 docker run ...

 

- options

d detach
i interactive
t pseudo tty(terminal)

--name=...

-- name ...

 
--restart=...
  • default is "no"
  • "always", "unless-stopped"
--rm  
-p  -p 8080:80
 -v

 --volume

the souce and the destination are seperated by a colon

--mount

 

 readonly/ro  
type=tmpfs

tmpfs-size=...

 

linux only

 

 docker ps

 -a for checking for all

-l for latest

 docker stop ...  
 docker images  
docker inspect ...  
   

Managing Docker Container Images

 docker pull ...  
 docker images

 options

  • --no-trunc
 docker history ...  
tag

 

docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

 

  • default tag is latest
 Dockerfile  
FROM  
LABEL  
ENV  
RUN

run a shell command

 

best practice: apt-get clean

COPY

&&: chain commands

\: line continuation character

EXPOSE  
CMD can be overridden by pass other values on the command line
ENTRYPOINT  
   

docker build -t ... ...

 -f: filename

docker rmi ...

 

docker system prune

-a: clean up all

docker system df

 

Running and Managing Docker Containers

 docker rm ...  
 docker stop ...  
 docker kill ...  
 docker log ...

-t

 
-f  

 

   

Connecting to Running Containers and Managing Container Output 

 docker exec -it ...  
 docker exec image-name cmd  
 docker top ...  ps
   
   

Docker Logging

   TODO
   
   
   
   

Docker Registries

   TODO
   
   
   
   

Building Images with Dockerfiles

 docker push  docker_id/repository:tag  
   
   
   
   

Docker Volumes

   
   
   
   
   

Docker Networking and Dockerizing Applications 

docker volume --help  
docker volume ls  
docker volume rm ...  
   
   
 

Docker Swarm

   
   
   
   
   

The End and the Beginning 

   
   
   
   
   
posted @ 2022-08-02 16:42  懒虫哥哥  阅读(18)  评论(0编辑  收藏  举报