Glossary

Flex Course:
Understanding Containers

reclaimed.tech

Reclaim Cloud

  • Customizable, Linux-based application containers
  • Root access, install all kinds of software, like a virtual machine
  • Can run Docker Engine

Docker

  • Containers built by developers to run a specific application
  • Can be run on your local computer (Docker Desktop) or anywhere you can install Docker Engine

Containers

Reclaim Cloud specifcs:

Environment = Grouping of containers

  • Allows for easier networking, HTTPS, shared storage, more!

Node = Single container

  • In some cases, you may need multiple containers in your environment to handle things like HTTPS, external databases etc.

Get a pre-configured container from a registry
   

Update containers that you are already using

docker pull

The most popular container registry

 

How do you know what images to pick?

  • Run a docker container directly from the command line.

  • There are multiple arguments that can be passed to containers run this way, but too many and this can be a cumbersome way of managing an application.

  • Run a docker container from the command line by reading directions from a YAML file:

    • docker-compose.yml

  • This method makes it easier to manage an application over time, as  you can edit the text file to make changes.

Running Docker Containers

You have two main methods:

-d run the container in the background (daemon mode)

-p  map port 8080 on the host to container port 80

-v make a volume called nextcloud to persistently store the contents of /var/www/html

nextcloud pull the nextcloud image from dockerhub and run it

Example: docker run

docker run -d -p 8080:80 -v nextcloud:/var/www/html nextcloud

-d run the container(s) in the background (daemon mode)

ports:  map port 8080 on the host to container port 80

volumes: make a volume called nextcloud to persistently store the contents of /var/www/html

image: pull the nextcloud image from dockerhub and run it

Example: docker-compose

version: '3.3'
services:
    app:
        image: nextcloud
        restart: always
        ports:
            - '8080:80'
        volumes:
            - 'nextcloud:/var/www/html'
volumes:
    nextcloud:

docker-compose.yml file:

command:

docker-compose up -d

Volumes

  • Stored in an abstracted file system available only to Docker
  • You work with files from inside of docker containers
  • data stored in /var/lib/docker/volumes

Bind Mounts

  • Data stored on the filesystem that is accessible to your server (host) and the docker container
  • You define the path
  • Can use the Reclaim Cloud config panel or SFTP

The persistent storage for a docker container. Anything not located in a docker volume or bind mount gets overwritten when pulling updates or even restarting a container

Configuration options for applications running in Docker. These are added by the developer of the docker container that you have pulled from a registry.


Can be passed via the docker run command, a .env file or as part of a docker-compose file.

 

 

A file that tells Docker how to build an image automatically.

 

A common pattern for a Dockerfile is to ask Docker to pull an image, but then automatically running several other commands inside the container to configure it to your needs.

 

This is one way that developers make the images that get uploaded to registries like Dockerhub.

 

Tags track the version of a Docker image that you can pull from a registry. If you do not specify a tag when pulling an image, you will get the image with the "latest" tag each time you pull the image.

Images

Images are versions of a container that you upload to or download from a registry. Containers that you run are built from that image.

docker ps

  • list all running containers

docker stop CONTAINER_NAME_OR_ID

  • stop a container

docker exec -it CONTAINER_NAME_OR_ID bash

  • get a shell inside of a container

docker-compose up -d

  • use docker-compose to run containers in the background

docker-compose down

  • stop containers

docker-compose logs -f

  • see the logs for all containers in a docker-compose stack and continue following them

docker-compose pull

  • pull updates for containers, you'll want to bring your containers down and back up after pulling updates

NOTE: all docker-compose commands must be run from a directory that contains a docker-compose.yml file