Skip to main content

What is Docker?

Docker

1000006253.png

1000006254.webp

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.

1000006255.png

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 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