What is Docker?
Docker
Docker on Linux shares the Linux kernel, allowing access to the hardware through your servers drivers, but it runs as an independent process that cannot access other containers or the host. It only has access to files and hardware we configure it to have access to. Many applications require at least one folder for persistent application configuration files and databases.
You can run a docker container from the terminal with one command.
sudo docker run --it --rm -d -p 80:80 --name nginx -v /srv/nginx/:/config scr.io/linuxserver/nginx:latest
You can directly mount host directories, create virtual volumes within docker, or create a temporary filesystem that exists in memory but is deleted whenever the container is restarted.
Docker compose, thanks to yaml, can also increase the readability of your docker setup process.
Docker compose is a docker engine tool that allows you to define and create new containers, as well as virtual networks connecting multiple containers at once. This makes it very easy to quickly pop-up containers, as well as increases security by allowing critical components like databases to be run behind the scenes so only the container has access to it.
services:
nginx:
image: lscr.io/linuxserver/nginx:latest
container_name: nginx
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los_Angeles
volumes:
- /srv/nginx/:/config
ports:
- 80:80
restart: unless-stopped
Portainer allows for the easy creation of dockee compose stacks through an intuitive interface.