Skip to content

Commit 8bdfdb8

Browse files
committed
Fix .bash_aliases to not to assume ~/IOTstack
* must change directory, as using only the '-f' flag would ignore a possibly existing `docker-compose.override.yml'
1 parent 5bcdfe8 commit 8bdfdb8

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

.bash_aliases

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
alias iotstack_up="docker-compose -f ~/IOTstack/docker-compose.yml up -d"
2-
alias iotstack_down="docker-compose -f ~/IOTstack/docker-compose.yml down"
3-
alias iotstack_start="docker-compose -f ~/IOTstack/docker-compose.yml start"
4-
alias iotstack_stop="docker-compose -f ~/IOTstack/docker-compose.yml stop"
5-
alias iotstack_update="docker-compose -f ~/IOTstack/docker-compose.yml pull"
6-
alias iotstack_build="docker-compose -f ~/IOTstack/docker-compose.yml build"
7-
1+
IOTSTACK_HOME="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2+
alias iotstack_up="cd "$IOTSTACK_HOME" && docker-compose up -d --build --remove-orphans"
3+
alias iotstack_down="cd "$IOTSTACK_HOME" && docker-compose down"
4+
alias iotstack_start="cd "$IOTSTACK_HOME" && docker-compose start"
5+
alias iotstack_stop="cd "$IOTSTACK_HOME" && docker-compose stop"
6+
alias iotstack_pull="cd "$IOTSTACK_HOME" && docker-compose pull"
7+
alias iotstack_build="cd "$IOTSTACK_HOME" && docker-compose build --pull --no-cache"
8+
alias iotstack_update_docker_images='f(){ iotstack_pull "$@" && iotstack_build "$@" && iotstack_up "$@"; }; f'

docs/Basic_setup/Docker.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ concern. Then you can enable log-rotation by either:
3434

3535
## Aliases
3636

37-
Bash aliases for stopping and starting the stack are in the file
38-
`.bash_aliases`. To use them immediately and in future logins, run in a
39-
console:
37+
Bash aliases for stopping and starting the stack and other common operations
38+
are in the file `.bash_aliases`. To use them immediately and in future logins,
39+
run in a console:
4040

4141
``` console
4242
$ source ~/IOTstack/.bash_aliases
@@ -45,13 +45,16 @@ $ echo ". ~/IOTstack/.bash_aliases" >> ~/.profile
4545

4646
These commands no longer need to be executed from the IOTstack directory and can be executed in any directory
4747

48-
``` console
49-
alias iotstack_up="docker-compose -f ~/IOTstack/docker-compose.yml up -d"
50-
alias iotstack_down="docker-compose -f ~/IOTstack/docker-compose.yml down"
51-
alias iotstack_start="docker-compose -f ~/IOTstack/docker-compose.yml start"
52-
alias iotstack_stop="docker-compose -f ~/IOTstack/docker-compose.yml stop"
53-
alias iotstack_update="docker-compose -f ~/IOTstack/docker-compose.yml pull"
54-
alias iotstack_build="docker-compose -f ~/IOTstack/docker-compose.yml build"
48+
``` bash title=".bash_aliases"
49+
--8<-- ".bash_aliases"
5550
```
5651

57-
You can now type `iotstack_up`, they even accept additional parameters `iotstack_stop portainer`
52+
You can now type `iotstack_up`. The aliases also accept additional parameters,
53+
e.g. `iotstack_stop portainer`.
54+
55+
The `iotstack_update_docker_images` alias will [update docker images](
56+
http://localhost:8000/Updates/#recommended-update-only-docker-images) to newest
57+
released images, build and recreate containers. Do note that using this will
58+
result in a broken containers from time to time, as upstream may release faulty
59+
docker images. Have proper backups, or be prepared to manually pin a previous
60+
release build by editing `docker-compose.yml`.

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ markdown_extensions:
6464
- pymdownx.highlight:
6565
pygments_lang_class: true
6666
- admonition
67+
- pymdownx.snippets
6768
- pymdownx.superfences:
6869
custom_fences:
6970
- name: mermaid

0 commit comments

Comments
 (0)