diff --git a/.bash_aliases b/.bash_aliases index a8d1d767..d0fd9001 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,7 +1,8 @@ -alias iotstack_up="docker-compose -f ~/IOTstack/docker-compose.yml up -d" -alias iotstack_down="docker-compose -f ~/IOTstack/docker-compose.yml down" -alias iotstack_start="docker-compose -f ~/IOTstack/docker-compose.yml start" -alias iotstack_stop="docker-compose -f ~/IOTstack/docker-compose.yml stop" -alias iotstack_update="docker-compose -f ~/IOTstack/docker-compose.yml pull" -alias iotstack_build="docker-compose -f ~/IOTstack/docker-compose.yml build" - +IOTSTACK_HOME="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +alias iotstack_up="cd "$IOTSTACK_HOME" && docker-compose up -d --build --remove-orphans" +alias iotstack_down="cd "$IOTSTACK_HOME" && docker-compose down" +alias iotstack_start="cd "$IOTSTACK_HOME" && docker-compose start" +alias iotstack_stop="cd "$IOTSTACK_HOME" && docker-compose stop" +alias iotstack_pull="cd "$IOTSTACK_HOME" && docker-compose pull" +alias iotstack_build="cd "$IOTSTACK_HOME" && docker-compose build --pull --no-cache" +alias iotstack_update_docker_images='f(){ iotstack_pull "$@" && iotstack_build "$@" && iotstack_up "$@"; }; f' diff --git a/docs/Basic_setup/Docker.md b/docs/Basic_setup/Docker.md index de97a8c7..b676a1c1 100644 --- a/docs/Basic_setup/Docker.md +++ b/docs/Basic_setup/Docker.md @@ -34,9 +34,9 @@ concern. Then you can enable log-rotation by either: ## Aliases -Bash aliases for stopping and starting the stack are in the file -`.bash_aliases`. To use them immediately and in future logins, run in a -console: +Bash aliases for stopping and starting the stack and other common operations +are in the file `.bash_aliases`. To use them immediately and in future logins, +run in a console: ``` console $ source ~/IOTstack/.bash_aliases @@ -45,13 +45,16 @@ $ echo ". ~/IOTstack/.bash_aliases" >> ~/.profile These commands no longer need to be executed from the IOTstack directory and can be executed in any directory -``` console -alias iotstack_up="docker-compose -f ~/IOTstack/docker-compose.yml up -d" -alias iotstack_down="docker-compose -f ~/IOTstack/docker-compose.yml down" -alias iotstack_start="docker-compose -f ~/IOTstack/docker-compose.yml start" -alias iotstack_stop="docker-compose -f ~/IOTstack/docker-compose.yml stop" -alias iotstack_update="docker-compose -f ~/IOTstack/docker-compose.yml pull" -alias iotstack_build="docker-compose -f ~/IOTstack/docker-compose.yml build" +``` bash title=".bash_aliases" +--8<-- ".bash_aliases" ``` -You can now type `iotstack_up`, they even accept additional parameters `iotstack_stop portainer` +You can now type `iotstack_up`. The aliases also accept additional parameters, +e.g. `iotstack_stop portainer`. + +The `iotstack_update_docker_images` alias will [update docker images]( +http://localhost:8000/Updates/#recommended-update-only-docker-images) to newest +released images, build and recreate containers. Do note that using this will +result in a broken containers from time to time, as upstream may release faulty +docker images. Have proper backups, or be prepared to manually pin a previous +release build by editing `docker-compose.yml`. diff --git a/mkdocs.yml b/mkdocs.yml index 9a4ba449..89cc885d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -64,6 +64,7 @@ markdown_extensions: - pymdownx.highlight: pygments_lang_class: true - admonition + - pymdownx.snippets - pymdownx.superfences: custom_fences: - name: mermaid