From 79d0efc25b42d5c750743bd9c0d6c0d18df8e147 Mon Sep 17 00:00:00 2001 From: Skybbles Date: Mon, 28 Mar 2022 16:17:56 -0400 Subject: doc: added BuildKit flags fix to INSTALL.md Added this because recently, there have been more problems with `docker-compose build` where it errors: ERROR: Service 'server' failed to build: failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument Recent Docker versions have switched to using `buildx` (BuildKit) to build containers, but that needs to be enabled, either in `daemon.json` or through an environment variable. But since we are using Docker Compose, it doesn't pass it to Docker; so the environment variable needs to be set. At least that's what I've heard and figured out sweat_smile My explanation might be very wrong - but it works :) --- doc/INSTALL.md | 100 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 27 deletions(-) (limited to 'doc/INSTALL.md') diff --git a/doc/INSTALL.md b/doc/INSTALL.md index d978e4a..ca0212b 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -34,33 +34,79 @@ and Docker Compose (version 1.6.0 or greater) already installed. Read the comments to guide you. Note that `.env` should be in the root directory of this repository. -### Running the Application - -Download containers: -```console -user@host:szuru$ docker-compose pull -``` - -For first run, it is recommended to start the database separately: -```console -user@host:szuru$ docker-compose up -d sql -``` - -To start all containers: -```console -user@host:szuru$ docker-compose up -d -``` - -To view/monitor the application logs: -```console -user@host:szuru$ docker-compose logs -f -# (CTRL+C to exit) -``` - -To stop all containers: -```console -user@host:szuru$ docker-compose down -``` +4. Pull the containers: + + This pulls the latest containers from docker.io: + ```console + user@host:szuru$ docker-compose pull + ``` + + If you have modified the application's source and would like to manually + build it, follow the instructions in [**Building**](#Building) instead, + then read here once you're done. + +5. Run it! + + For first run, it is recommended to start the database separately: + ```console + user@host:szuru$ docker-compose up -d sql + ``` + + To start all containers: + ```console + user@host:szuru$ docker-compose up -d + ``` + + To view/monitor the application logs: + ```console + user@host:szuru$ docker-compose logs -f + # (CTRL+C to exit) + ``` + +### Building + +1. Edit `docker-compose.yml` to tell Docker to build instead of pull containers: + + ```diff yaml + ... + server: + - image: szurubooru/server:latest + + build: server + ... + client: + - image: szurubooru/client:latest + + build: client + ... + ``` + + You can choose to build either one from source. + +2. Build the containers: + + ```console + user@host:szuru$ docker-compose build + ``` + + That will attempt to build both containers, but you can specify `client` + or `server` to make it build only one. + + If `docker-compose build` spits out: + + ``` + ERROR: Service 'server' failed to build: failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument + ``` + + ...you will need to export Docker BuildKit flags: + + ```console + user@host:szuru$ export DOCKER_BUILDKIT=1; export COMPOSE_DOCKER_CLI_BUILD=1 + ``` + + ...and run `docker-compose build` again. + +*Note: If your changes are not taking effect in your builds, consider building +with `--no-cache`.* + ### Additional Features -- cgit v1.3 From 4fd848abf2998fcfc13d6a01cee4aaadf984aafb Mon Sep 17 00:00:00 2001 From: neobooru Date: Tue, 11 Feb 2025 21:25:10 +0100 Subject: doc: use docker compose instead of docker-compose The minimum version requirements are rough guesses, in practice any decently modern docker installation should work. --- doc/INSTALL.md | 20 ++++++++++---------- docker-compose.yml | 4 +--- 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'doc/INSTALL.md') diff --git a/doc/INSTALL.md b/doc/INSTALL.md index ca0212b..a1598b8 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -1,5 +1,5 @@ -This assumes that you have Docker (version 17.05 or greater) -and Docker Compose (version 1.6.0 or greater) already installed. +This assumes that you have Docker (version 19.03 or greater) +and the Docker Compose CLI (version 1.27.0 or greater) already installed. ### Prepare things @@ -38,7 +38,7 @@ and Docker Compose (version 1.6.0 or greater) already installed. This pulls the latest containers from docker.io: ```console - user@host:szuru$ docker-compose pull + user@host:szuru$ docker compose pull ``` If you have modified the application's source and would like to manually @@ -49,17 +49,17 @@ and Docker Compose (version 1.6.0 or greater) already installed. For first run, it is recommended to start the database separately: ```console - user@host:szuru$ docker-compose up -d sql + user@host:szuru$ docker compose up -d sql ``` To start all containers: ```console - user@host:szuru$ docker-compose up -d + user@host:szuru$ docker compose up -d ``` To view/monitor the application logs: ```console - user@host:szuru$ docker-compose logs -f + user@host:szuru$ docker compose logs -f # (CTRL+C to exit) ``` @@ -84,13 +84,13 @@ and Docker Compose (version 1.6.0 or greater) already installed. 2. Build the containers: ```console - user@host:szuru$ docker-compose build + user@host:szuru$ docker compose build ``` That will attempt to build both containers, but you can specify `client` or `server` to make it build only one. - If `docker-compose build` spits out: + If `docker compose build` spits out: ``` ERROR: Service 'server' failed to build: failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument @@ -102,7 +102,7 @@ and Docker Compose (version 1.6.0 or greater) already installed. user@host:szuru$ export DOCKER_BUILDKIT=1; export COMPOSE_DOCKER_CLI_BUILD=1 ``` - ...and run `docker-compose build` again. + ...and run `docker compose build` again. *Note: If your changes are not taking effect in your builds, consider building with `--no-cache`.* @@ -117,7 +117,7 @@ with `--no-cache`.* run from docker: ```console - user@host:szuru$ docker-compose run server ./szuru-admin --help + user@host:szuru$ docker compose run server ./szuru-admin --help ``` will give you a breakdown on all available commands. diff --git a/docker-compose.yml b/docker-compose.yml index 38e08b9..4fd677d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,7 @@ ## Example Docker Compose configuration ## -## Use this as a template to set up docker-compose, or as guide to set up other +## Use this as a template to set up docker compose, or as guide to set up other ## orchestration services -version: '2' - services: server: -- cgit v1.3