Skip to content

Commit

Permalink
Add update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Minituff committed Oct 21, 2023
1 parent 5e5e185 commit b03385a
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"description": "Self Docker image version updates",
"fileMatch": [
".*docker-run-example",
".*docker-run-semver-example",
"README.md"
],
"matchStrings": [
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For a full list of configuration options, see the [Variables](./arguments.md) se

------8<------ "docker-example-tooltips.md"

## Docker Run Example
## Docker CLI Example

```bash
------8<------ "docker-run-example.sh"
Expand Down
132 changes: 132 additions & 0 deletions docs/updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
Updating Nautical <small>(and any continer)</small> is a balance between *convenience*, *reliability* and *security*.

Updating your container will bring new features, bug fixes and security patches but can also introduce intended behavior.


## Understanding Semantic Versioning
[Semver](https://semver.org) is a means to communicate the changes to an application just by looking at the version number.
Nautical uses [Semver](https://semver.org) like this.

`vMAJOR.MINOR.PATCH`, for example:
<a href="https://hub.docker.com/r/minituff/nautical-backup"><img alt="Docker Image Version (latest semver)" src="https://img.shields.io/docker/v/minituff/nautical-backup/latest?label= " /></a>

* **MAJOR** - A large change that breaks/reworks an existing feature.
* This usually means you will need to change the Nautical configuration.
* **MINOR** - Add functionality in a backward compatible manner.
* Everything *should* continue working without changes to the Nautical configuration.
* **PATCH** - A small change such as updating a depedency, log output, or minor fix.
* From the user perspective, nothing will have changed, but under the hood, small improvements were made.

## Manual Updates
To manually update Nautical, simply re-deploy using either of these configs, but specify the latest version of the Nautical.
Currently, the latest version of Nautical is <a href="https://hub.docker.com/r/minituff/nautical-backup"><img alt="Docker Image Version (latest semver)" src="https://img.shields.io/docker/v/minituff/nautical-backup/latest?label= " /></a>. <small>(do not add the `v`)</small>

This will need to be done each time a new verison is released.
=== "Docker Compose"
```yaml
------8<------ "docker-compose-semver-example.yml:3"
------8<------ "docker-compose-example.yml:6:10"
```

------8<------ "docker-example-tooltips.md"

=== "Docker Cli"

```bash
------8<------ "docker-run-example.sh::6"
------8<------ "docker-run-semver-example.sh"

# Update the version number in the line above
```

------8<------ "docker-example-tooltips.md"


## Automatic Updates
[Watchtower](https://github.com/containrrr/watchtower/) is an excellent tool to keep your Docker containers update.

While convenient, automatic updates may break things. For this reason we recommend only automatically updating to the latest `PATCH` version.

### Patch Updates Only
These examples only specify the [Semver](https://semver.org) `vMAJOR.MINOR` numbers, leaving `PATCH` out--this means that Watchtower will the `PATCH` number if available.

=== "Docker Compose"
```yaml
------8<------ "docker-compose-example.yml:3:10"

watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: nautical-backup # (9)!
```

------8<------ "docker-example-tooltips.md"
1. Which containers to use.

Remove this line to update all contianers.

=== "Docker Cli"
```bash
------8<------ "docker-run-example.sh::6"
------8<------ "docker-run-example.sh:10:"

docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
nautical-backup #(9)!
```

------8<------ "docker-example-tooltips.md"
1. Which containers to use.

Remove this line to update all contianers.


### Latest Updates (All)
If you're really feeling like living on the bleeding edge. You can use the `latest` tag to ensure you are always up to date.

!!! danger "This will most likely break things at some point"
If you go this route, just ensure you aren't using Nautical for anything mission critical, and be prepared to either help troubleshoot or wait for a new version with a bug fix.

This is an example of using [Watchtower](https://github.com/containrrr/watchtower/) to keep Nautical on the `latest` version.

=== "Docker Compose"
```yaml
------8<------ "docker-compose-example.yml:3:4"
image: minituff/nautical-backup:latest
------8<------ "docker-compose-example.yml:6:10"

watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: nautical-backup # (9)!
```

------8<------ "docker-example-tooltips.md"
1. Which containers to use.

Remove this line to update all contianers.

=== "Docker Cli"
```bash
------8<------ "docker-run-example.sh::6"
minituff/nautical-backup:latest

docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
nautical-backup #(9)!
```

------8<------ "docker-example-tooltips.md"
1. Which containers to use.

Remove this line to update all contianers.


3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edit_uri: 'edit/main/docs/'
repo_name: 'GitHub'
repo_url: 'https://github.com/minituff/nautical-backup'

copyright: 'Copyright &copy; 2023 James Tufarelli'
# copyright: 'Copyright &copy; 2023 James Tufarelli'

# hide:
# - footer
Expand Down Expand Up @@ -37,6 +37,7 @@ nav:
- Installation: installation.md
- Variables: arguments.md
- Docker Labels: labels.md
- Updating Nautical: updates.md
- Advanced Usage:
- Source & Destination Mappings: advanced/advanced.md
- NFS Shares: advanced/nfs-share.md
Expand Down
5 changes: 5 additions & 0 deletions snippets/docker-compose-semver-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
version: '3'
services:
nautical-backup:
image: minituff/nautical-backup:0.3.10 # Change this to the latest version
1 change: 1 addition & 0 deletions snippets/docker-run-semver-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
minituff/nautical-backup:0.3.10

0 comments on commit b03385a

Please sign in to comment.