Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
27 Cards in this Set
- Front
- Back
What's Docker |
Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries, and configuration files; they can communicate with each other through well-defined channels |
|
What's the difference from Docker and Virtual Machine |
VM is piece of software that allows you to install other software inside of it so you basically control it virtually as opposed to installing the software directly on the computer. While a container is a software that allows different functionalities of an application independently. |
|
How to build an image? |
docker build -t myimage:1.0 . |
|
How to run a container in docker ? |
docker container run --name web |
|
How to pull the logs from a container? |
docker logs --tail 100 web |
|
How to list running containers |
docker container ls |
|
How to list all the images in docker |
docker image ls |
|
What's Docker Hub |
Docker's public repository for images |
|
What's the difference between docker and docker-compose? |
Docker commands are focused on only one container (or image) at once while docker-compose manage several containers docker. |
|
What's the difference between CMD, RUN, EntryPoint? |
RUN always creates a new intermediate image layer on top of the previous ones. |
|
What's the difference between ADD, COPY ? |
ADD - can copy from a directory or from a URL, it can copy a compressed files and automatically extract them. |
|
What's EXPOSE ? |
EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. It doesn't publish the port. |
|
How to optimize Docker image size ? |
2) Base image as small as possible (alpine, busybox) 2) --no-install-recommends on install commands 3) clean-apt and remove temporary files 5) use multistage dockerfiles, in stage1 to use full SDK, in stage2 use artifact from stage2 with runtime only |
|
Rootless controller |
Containers that can be created, run, and managed by users without admin rights. |
|
Command to build an image |
docker build -t <name>:<tag> |
|
Command to list all images |
docker images |
|
Command to remove image |
docker image rm <name> |
|
Command to pull an image |
docker pull <name>:<tag> |
|
Command to push and image to the registry (repo) |
docker push <name>:<tag> |
|
Command to run a container |
docker run <name> |
|
Command to stop a container |
docker stop <name> |
|
Command to kill a container |
docker kill <name> |
|
Command list the networks |
docker network ls |
|
Command to list all running containers |
docker ls docker ps docker ls -a docker ps -a |
|
Command to print last 100 lines of container's logs |
docker logs --tail 100 <name> |
|
Command to ssh into container |
docker exec –it <name> /bin/bash |
|
Command to run a command in the containers |
docker exec -it <command> docker exec -it pwd docker exec -it ls -l |