Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 2.23 KB

File metadata and controls

38 lines (29 loc) · 2.23 KB

What is Docker?

Docker is a software platform that allows you to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime. Using Docker, you can quickly deploy and scale applications into any environment and know your code will run.

Installation

https://docs.docker.com/desktop/mac/install/

Commands

List out all running containers

docker ps

Creating new image

docker build -t [docker hub username]/[appname]:[version] [current directory]

Anatomy

Dockerfile

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.

Docker ignore

The .dockerignore file is very similar to the .gitignore file in that it allows you to specify a list of files or directories that Docker is to ignore during the build process. This can come in really handy in certain instances.

Docker Image

A Docker image is a file used to execute code in a Docker container. Docker images act as a set of instructions to build a Docker container, like a template. Docker images also act as the starting point when using Docker. An image is comparable to a snapshot in virtual machine (VM) environments.

Docker Container

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings

Docker Volume

Volumes are the preferred mechanism for persisting data generated by and used by Docker containers. While bind mounts are dependent on the directory structure and OS of the host machine, volumes are completely managed by Docker.

FAQ

What is "COPY . ."

"." Simply means current working directory, so it means copy files from current directory to current directory.

Docker build not working

Add DOCKER_BUILDKIT=0 in front of the docker build command to print the command output like the previous Docker version.