Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix and update Docker documentation #1887

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ The CLI can be used in Docker without any problem.

In order to use it you must mount the scaleway configuration file:
```sh
docker run -it --rm -v $HOME/.config/scw:/.config/scw scaleway/cli:v2.0.0
docker run -it --rm -v $HOME/.config/scw:/root/.config/scw scaleway/cli:v2.3.0
```

If you want to use `scw` instead of `docker run` you can add the following in your `~/.bashrc`:
```bash
scw() {
docker run -it --rm -v $HOME/.config/scw:/.config/scw scaleway/cli:v2.0.0 "$@"
docker run -it --rm -v $HOME/.config/scw:/root/.config/scw scaleway/cli:v2.3.0 "$@"
}
export -f scw
```

Or if you use ZSH, add the following in your `~/.zshrc`:
```zsh
scw() {
docker run -it --rm -v $HOME/.config/scw:/.config/scw scaleway/cli:v2.0.0 $@
docker run -it --rm -v $HOME/.config/scw:/root/.config/scw scaleway/cli:v2.3.0 $@
}
```

Expand All @@ -44,14 +44,14 @@ complete -F _scw scw
And in your `~/.bashrc` you can add:
```bash
scw() {
docker run -it --rm -v $HOME/.config/scw:/.config/scw scaleway/cli:v2.0.0 "$@"
docker run -it --rm -v $HOME/.config/scw:/root/.config/scw scaleway/cli:v2.3.0 "$@"
}
export -f scw

_scw() {
_get_comp_words_by_ref -n = cword words

output=$(docker run -i --rm -v $HOME/.config/scw:/.config/scw scaleway/cli:v2.0.0 autocomplete complete bash -- "$COMP_LINE" "$cword" "${words[@]}")
output=$(docker run -i --rm -v $HOME/.config/scw:/root/.config/scw scaleway/cli:v2.3.0 autocomplete complete bash -- "$COMP_LINE" "$cword" "${words[@]}")
COMPREPLY=($output)
# apply compopt option and ignore failure for older bash versions
[[ $COMPREPLY == *= ]] && compopt -o nospace 2> /dev/null || true
Expand Down