@@ -6,24 +6,36 @@ The CLI can be used in Docker without any problem.
66
77In order to use it you must mount the scaleway configuration file:
88``` sh
9- docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.3 .0
9+ docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.26 .0
1010```
1111
1212If you want to use ` scw ` instead of ` docker run ` you can add the following in your ` ~/.bashrc ` :
1313``` bash
1414scw () {
15- docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.3 .0 " $@ "
15+ docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.26 .0 " $@ "
1616}
1717export -f scw
1818```
1919
2020Or if you use ZSH, add the following in your ` ~/.zshrc ` :
2121``` zsh
2222scw () {
23- docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.3 .0 $@
23+ docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.26 .0 $@
2424}
2525```
2626
27+ ## Use your ssh-key
28+
29+ In order to use your ssh-key you must mount your .ssh folder
30+ ``` sh
31+ docker run -it --rm -v $HOME /.config/scw:/root/.config/scw -v $HOME /.ssh:/root/.ssh scaleway/cli:v2.26.0 $@
32+ ```
33+
34+ You can then ensure that your ssh key is present in your Scaleway account
35+ ``` sh
36+ scw iam ssh-key init
37+ ```
38+
2739## Autocompletion
2840
2941You can still use autocompletion while running the CLI in Docker, you just need to modify script generated by the CLI.
@@ -44,14 +56,14 @@ complete -F _scw scw
4456And in your ` ~/.bashrc ` you can add:
4557``` bash
4658scw () {
47- docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.3 .0 " $@ "
59+ docker run -it --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.26 .0 " $@ "
4860}
4961export -f scw
5062
5163_scw () {
5264 _get_comp_words_by_ref -n = cword words
5365
54- output=$( docker run -i --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.3 .0 autocomplete complete bash -- " $COMP_LINE " " $cword " " ${words[@]} " )
66+ output=$( docker run -i --rm -v $HOME /.config/scw:/root/.config/scw scaleway/cli:v2.26 .0 autocomplete complete bash -- " $COMP_LINE " " $cword " " ${words[@]} " )
5567 COMPREPLY=($output )
5668 # apply compopt option and ignore failure for older bash versions
5769 [[ $COMPREPLY == * = ]] && compopt -o nospace 2> /dev/null || true
@@ -66,5 +78,5 @@ The trick is to remove the `-t` when using docker inside the completion function
6678If running with Podman and SELinux in enforcing mode, one must use the : Z option when mounting the configuration file.
6779For instance:
6880``` bash
69- podman run -it --rm -v $HOME /.config/scw:/root/.config/scw:Z scaleway/cli:v2.3 .0
81+ podman run -it --rm -v $HOME /.config/scw:/root/.config/scw:Z scaleway/cli:v2.26 .0
7082```
0 commit comments