Use long form for env_file parameters to enabling secret-free linting #120

Closed
opened 2024-02-12 16:09:52 -08:00 by Jafner · 3 comments
Owner

https://github.com/docker/compose/issues/3560

Compose v2.24.0 provided a long format for the env_file parameter which allows setting a file as required: false. This allows docker compose config to exit 0 when a secrets file is missing.

  • Ensure Docker hosts are running Docker Compose v2.24.0 or later.
    • fighter
    • druid
  • Switch all env_file declarations to long format. Set secrets to required: false, otherwise required: true.
    • druid/gitea
    • druid/vaultwarden
    • druid/wireguard
    • fighter/autopirate
    • fighter/keycloak
    • fighter/minecraft
    • fighter/monitoring
    • fighter/nextcloud
    • fighter/plex
    • fighter/vandam
    • fighter/wireguard

Use the following format:

    env_file:
      - path: ./$APP.env
        required: true
      - path: ./$APP_secrets.env
        required: false
https://github.com/docker/compose/issues/3560 Compose `v2.24.0` provided a long format for the `env_file` parameter which allows setting a file as `required: false`. This allows `docker compose config` to exit 0 when a secrets file is missing. - [x] Ensure Docker hosts are running Docker Compose `v2.24.0` or later. - [x] `fighter` - [x] `druid` - [x] Switch all `env_file` declarations to long format. Set secrets to `required: false`, otherwise `required: true`. - [x] `druid/gitea` - [x] `druid/vaultwarden` - [x] `druid/wireguard` - [x] `fighter/autopirate` - [x] `fighter/keycloak` - [x] `fighter/minecraft` - [x] `fighter/monitoring` - [x] `fighter/nextcloud` - [x] `fighter/plex` - [x] `fighter/vandam` - [x] `fighter/wireguard` Use the following format: ```yml env_file: - path: ./$APP.env required: true - path: ./$APP_secrets.env required: false ```
Author
Owner

Install Latest Docker (and Compose) for Debian 12

Tested on fighter

  1. Set up the Docker repository in apt.
    a. Add Docker's GPG key to the keyring with sudo install -m 0755 -d /etc/apt/keyrings && sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && sudo chmod a+r /etc/apt/keyrings/docker.asc.
    b. Add the repository to apt with echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null.
    c. Fetch the package list with sudo apt-get update.
  2. Install Docker packages. Run sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  3. Verify the version. Run docker compose version. Should be >= v2.24.0.
# Install Latest Docker (and Compose) for Debian 12 *Tested on* `fighter` 1. Set up the Docker repository in apt. a. Add Docker's GPG key to the keyring with `sudo install -m 0755 -d /etc/apt/keyrings && sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && sudo chmod a+r /etc/apt/keyrings/docker.asc`. b. Add the repository to apt with `echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null`. c. Fetch the package list with `sudo apt-get update`. 2. Install Docker packages. Run `sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin` 3. Verify the version. Run `docker compose version`. Should be >= `v2.24.0`.
Author
Owner

Install Latest Compose for Debian 11

Tested on druid

Because Debian 11 has been suspended, the latest version of Compose available is v2.0.1. We need v2.24.0.

  1. Install the new version of the Compose plugin over the old one. Run sudo curl -SL https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose to overwrite the plugin with version v2.24.5.
  2. Delete the old /usr/bin/docker-compose plugin. Run sudo rm /usr/bin/docker-compose.
  3. Replace the docker-compose command with a simple alias. Run echo 'docker compose "$@"' | sudo tee /usr/bin/docker-compose.
  4. Verify both variants of the command are working. Run docker compose version, followed by docker-compose version. Both should return Docker Compose version v2.24.5.
# Install Latest Compose for Debian 11 *Tested on* `druid` Because Debian 11 has been suspended, the latest version of Compose available is `v2.0.1`. We need `v2.24.0`. 1. Install the new version of the Compose plugin over the old one. Run `sudo curl -SL https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose` to overwrite the plugin with version `v2.24.5`. 2. Delete the old `/usr/bin/docker-compose` plugin. Run `sudo rm /usr/bin/docker-compose`. 3. Replace the `docker-compose` command with a simple alias. Run `echo 'docker compose "$@"' | sudo tee /usr/bin/docker-compose`. 4. Verify both variants of the command are working. Run `docker compose version`, followed by `docker-compose version`. Both should return `Docker Compose version v2.24.5`.
Jafner referenced this issue from a commit 2024-02-12 21:27:43 -08:00
Jafner referenced this issue from a commit 2024-02-12 22:11:56 -08:00
Jafner referenced this issue from a commit 2024-02-12 22:24:54 -08:00
Jafner referenced this issue from a commit 2024-02-12 22:38:19 -08:00
Jafner referenced this issue from a commit 2024-02-12 22:43:07 -08:00
Jafner referenced this issue from a commit 2024-02-12 23:13:27 -08:00
Jafner referenced this issue from a commit 2024-02-12 23:27:20 -08:00
Jafner referenced this issue from a commit 2024-02-12 23:27:59 -08:00
Jafner referenced this issue from a commit 2024-02-12 23:33:27 -08:00
Jafner referenced this issue from a commit 2024-02-12 23:34:56 -08:00
Jafner referenced this issue from a commit 2024-02-12 23:47:43 -08:00
Jafner referenced this issue from a commit 2024-02-12 23:48:58 -08:00
Author
Owner

I'm not sure if this is such a good idea. Gonna sleep on it.

I'm not sure if this is such a good idea. Gonna sleep on it.
Jafner referenced this issue from a commit 2024-02-13 10:50:02 -08:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Jafner/homelab#120
No description provided.