From 461c1a9bd50e07f51fa447f4e3698ad940a1b7fe Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 May 2024 18:42:13 +0200 Subject: [PATCH 1/3] put building/obtaining image instructions before trying to run it. --- AUTHORS.rst | 1 + extras/docker/development/README.md | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index fc437ed7f..02dfe98e1 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -76,6 +76,7 @@ Developers * Alexandra Rhodes - https://github.com/arhodes130 * Jayanth Bontha - https://github.com/JayanthBontha * Ethan Winters - https://github.com/ebwinters +* Dieter Plaetinck - https://github.com/Dieterbe Translators ----------- diff --git a/extras/docker/development/README.md b/extras/docker/development/README.md index cdb7c1d71..b3ae623b9 100644 --- a/extras/docker/development/README.md +++ b/extras/docker/development/README.md @@ -18,7 +18,19 @@ it is self-contained). A more comfortable development version is provided in the compose folder. -### 1 - Start the container +### 1 - Obtaining/building the docker image + +We will run the `wger/server:latest` image in the next step. + +You can either download it from [dockerhub](https://hub.docker.com/r/wger/server); docker will do this automatically if you have no such image with that tag yet. +You can also run `docker pull wger/server` to get the latest version. (you can use `docker images` to see if your image is old) + +Alternatively, you can build it yourself from your wger code checkout. +To do this, you **must** build from the project root! + +```docker build -f extras/docker/development/Dockerfile --tag wger/server .``` + +### 2 - Start the container docker run -ti \ -v /path/to/your/wger/checkout:/home/wger/src \ @@ -37,7 +49,7 @@ You might also want to download the exercise images and the ingredients docker exec wger.devel python3 manage.py download-exercise-images docker exec wger.devel wger load-online-fixtures -### 2 - Open the Application +### 3 - Open the Application Just open and log in as: **admin**, password **adminadmin** @@ -49,20 +61,13 @@ To start developing again: ```sudo docker container start --attach wger.devel``` -### 3 - Other commands +### 4 - Other commands If you need to update the CSS/JS libraries or just issue some other command: docker exec -ti wger.devel yarn docker exec -ti wger.devel /bin/bash -## Building - -If you build this yourself, keep in mind that you **must** build from the -project root! - -```docker build -f extras/docker/development/Dockerfile --tag wger/server .``` - ## Contact Feel free to contact us if you found this useful or if there was something that From 9f54dced44ee011f9483310e0df76f8652e0e16c Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 May 2024 19:01:33 +0200 Subject: [PATCH 2/3] fix COPY statement Step 4/23 : COPY requirements* . When using COPY with more than one source file, the destination must be a directory and end with a / --- extras/docker/development/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/docker/development/Dockerfile b/extras/docker/development/Dockerfile index 718ad0e60..0428dd66e 100644 --- a/extras/docker/development/Dockerfile +++ b/extras/docker/development/Dockerfile @@ -31,7 +31,7 @@ RUN apt update \ # Build the necessary python wheels # Note that the --mount tmpfs is a workaround for https://github.com/rust-lang/cargo/issues/8719 -COPY requirements* . +COPY requirements* ./ RUN --mount=type=tmpfs,target=/root/.cargo \ pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt From 875fe4bb32c83556f55128e0a51a0a55367ed6b6 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 May 2024 19:10:09 +0200 Subject: [PATCH 3/3] add instructions for buildx I was getting this warning...: DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/buildx/ ...and later on, this failure: Step 5/23 : RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled --- extras/docker/development/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extras/docker/development/README.md b/extras/docker/development/README.md index b3ae623b9..aeb04db04 100644 --- a/extras/docker/development/README.md +++ b/extras/docker/development/README.md @@ -18,7 +18,11 @@ it is self-contained). A more comfortable development version is provided in the compose folder. -### 1 - Obtaining/building the docker image +### 1 - Installing docker + +Install docker, and the docker buildx tool (if they are separate packages on your system, e.g. on Arch Linux) + +### 2 - Obtaining/building the docker image We will run the `wger/server:latest` image in the next step. @@ -30,7 +34,7 @@ To do this, you **must** build from the project root! ```docker build -f extras/docker/development/Dockerfile --tag wger/server .``` -### 2 - Start the container +### 3 - Start the container docker run -ti \ -v /path/to/your/wger/checkout:/home/wger/src \ @@ -49,7 +53,7 @@ You might also want to download the exercise images and the ingredients docker exec wger.devel python3 manage.py download-exercise-images docker exec wger.devel wger load-online-fixtures -### 3 - Open the Application +### 4 - Open the Application Just open and log in as: **admin**, password **adminadmin** @@ -61,7 +65,7 @@ To start developing again: ```sudo docker container start --attach wger.devel``` -### 4 - Other commands +### 5 - Other commands If you need to update the CSS/JS libraries or just issue some other command: