mirror of
https://github.com/tborychowski/self-hosted-cookbook.git
synced 2025-05-16 04:20:46 +00:00
get started
This commit is contained in:
parent
b9f0cfc995
commit
30e5c241af
@ -18,8 +18,7 @@ So, without further ado, here's the current list:
|
|||||||
|
|
||||||
|
|
||||||
# General Information
|
# General Information
|
||||||
- [How to setup docker & docker-compose?](docker/setup.md)
|
- [Get started with docker & docker-compose](docker/get-started.md)
|
||||||
- [How to use docker-compose](docker/usage.md)
|
|
||||||
- [Troubleshooting](docker/troubleshooting.md)
|
- [Troubleshooting](docker/troubleshooting.md)
|
||||||
|
|
||||||
# Other self-hosted sources
|
# Other self-hosted sources
|
||||||
|
63
docker/get-started.md
Normal file
63
docker/get-started.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# Get started with docker & docker-compose
|
||||||
|
|
||||||
|
Installation instructions for Ubuntu Linux from: https://docs.docker.com/engine/install/ubuntu/
|
||||||
|
|
||||||
|
|
||||||
|
## Uninstall old versions
|
||||||
|
```sh
|
||||||
|
sudo apt-get remove docker docker-engine docker.io containerd runc
|
||||||
|
```
|
||||||
|
|
||||||
|
## Install Docker
|
||||||
|
```sh
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||||
|
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install docker-ce docker-ce-cli containerd.io
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Install `docker-compose`
|
||||||
|
From: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt-get remove docker-compose
|
||||||
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Full docs are here: https://docs.docker.com/compose/reference/overview/
|
||||||
|
|
||||||
|
Generally the idea of `docker-compose` command is simple:
|
||||||
|
1. First you create a folder for your service, e.g. `home-assistant`
|
||||||
|
2. Then you then create a `docker-compose.yml` file, which describes the service containers
|
||||||
|
3. You run `docker-compose up -d` and you're done!
|
||||||
|
|
||||||
|
Here are the most frequently used commands:
|
||||||
|
|
||||||
|
|
||||||
|
#### Start a container
|
||||||
|
`-d` starts in a detached mode - which basically mean that it runs it in the background (so you can do other stuff, instead of looking at the logs).
|
||||||
|
```sh
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### Stop a container
|
||||||
|
There are 2 options:
|
||||||
|
```sh
|
||||||
|
docker-compose stop
|
||||||
|
docker-compose down
|
||||||
|
```
|
||||||
|
First one (`stop`) onlu stops the containers, whereas the latter (`down`) does some more cleaning (removes the containers, networks, volumes), so I generally recommend `down` if you're tinkering.
|
||||||
|
|
||||||
|
|
||||||
|
### Update a container to use the latest published image
|
||||||
|
```sh
|
||||||
|
docker-compose pull && docker-compose up -d
|
||||||
|
```
|
||||||
|
This pulls the latest images as defined in the local `docker-compose.yml` and recreates the containers.
|
@ -1,34 +0,0 @@
|
|||||||
# Docker Setup
|
|
||||||
|
|
||||||
Installation instructions for Ubuntu Linux: https://docs.docker.com/engine/install/ubuntu/
|
|
||||||
|
|
||||||
|
|
||||||
## Uninstall old versions
|
|
||||||
```sh
|
|
||||||
sudo apt-get remove docker docker-engine docker.io containerd runc
|
|
||||||
```
|
|
||||||
|
|
||||||
## Install Docker
|
|
||||||
```sh
|
|
||||||
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
|
|
||||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
||||||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install docker-ce docker-ce-cli containerd.io
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Install `docker-compose`
|
|
||||||
From: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04
|
|
||||||
|
|
||||||
```sh
|
|
||||||
### ERROR: Version in "./docker-compose.yml" is unsupported.
|
|
||||||
```sh
|
|
||||||
sudo apt-get remove docker-compose
|
|
||||||
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
|
||||||
sudo chmod +x /usr/local/bin/docker-compose
|
|
||||||
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
|
||||||
```
|
|
@ -1,7 +1,8 @@
|
|||||||
# Docker Troubleshooting
|
# Docker Troubleshooting
|
||||||
|
Same as **Get Started** section - these instructions are for Ubuntu Linux.
|
||||||
|
|
||||||
### ERROR: Version in "./docker-compose.yml" is unsupported.
|
### ERROR: Version in "./docker-compose.yml" is unsupported.
|
||||||
|
You need to update your `docker-compose` version:
|
||||||
```sh
|
```sh
|
||||||
sudo apt-get remove docker-compose
|
sudo apt-get remove docker-compose
|
||||||
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||||
@ -29,19 +30,19 @@ OCI runtime create failed: container_linux.go:349: starting container process ca
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### Follow These Steps:
|
#### Follow These Steps:
|
||||||
1. edit grub
|
1. Edit grub
|
||||||
```sh
|
```sh
|
||||||
sudo nano /etc/default/grub
|
sudo nano /etc/default/grub
|
||||||
```
|
```
|
||||||
2. change GRUB_CMDLINE_LINUX value to the below:
|
2. Change `GRUB_CMDLINE_LINUX` value as below:
|
||||||
```
|
```
|
||||||
GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=0"
|
GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=0"
|
||||||
```
|
```
|
||||||
3. then run:
|
3. Reconfigure grub:
|
||||||
```sh
|
```sh
|
||||||
grub2-mkconfig
|
grub2-mkconfig
|
||||||
```
|
```
|
||||||
4. then:
|
4. Finally reboot the system:
|
||||||
```sh
|
```sh
|
||||||
sudo reboot
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
@ -1 +0,0 @@
|
|||||||
# Docker Usage
|
|
Loading…
Reference in New Issue
Block a user