Files
wiki/content/projects/Docker/index.md

92 lines
3.0 KiB
Markdown

---
title: Docker
description: Quick overview of docker and setup
date: 2023-11-26T01:14:53.675Z
lastmod: 2025-02-11
author: wompmacho
showHero: false # needed to hide "hero banner"
---
## What is Docker?
Docker is an awesome platform that anyone hoping to get into software /
development or any homelab-er should become familiar with. Docker is a platform
designed to help developers build, share, and run container applications. The
most important aspect to docker is its ability to be implemented in version
control via simple config files. This allowing a team of people to share a code
base working in the same environments consistently.
Almost anything can be deployed as a service via docker. It is a fantastic tool
to learn about apps, software, test operating systems, do things like home
automation, run web servers, media servers, host your own proxy/reverse proxy,
email, dns, network monitoring, websites etc.
{{< rawhtml >}}
<div class="iframe-wrapper" style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
<iframe width="" height="" src="https://www.youtube.com/embed/NPguawVjbN0?si=rCFmobnPOrK9yl--" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div>
{{< /rawhtml >}}
---
## Docker Environment Setup
I am doing things with Ubuntu, so for my case I will follow this [docker.com -
GUIDE](https://docs.docker.com/engine/install/ubuntu/) for setting up the
initial docker environment on my ubuntu machine and then running the test
hello-world docker container app to verify that my docker environment is
working.
- Set up Docker's apt repository.
``` bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
```
- Install the Docker packages.
``` bash
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
- Verify that the Docker Engine installation is successful by running the
hello-world image.
``` bash
sudo docker run hello-world
```
---
## Docker Compose
## .env Variables
## Docker Files
> [!NOTE]
> [dockerfile](https://docs.docker.com/reference/dockerfile/)
>
> Example rebuild for mkdocs with some mods
>
> ```
> FROM squidfunk/mkdocs-material
> RUN pip install mkdocs-macros-plugin
> RUN pip install mkdocs-glightbox
> ```
## Mounting remote storage