@@ -6,24 +6,36 @@ The CLI can be used in Docker without any problem.
6
6
7
7
In order to use it you must mount the scaleway configuration file:
8
8
``` 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
10
10
```
11
11
12
12
If you want to use ` scw ` instead of ` docker run ` you can add the following in your ` ~/.bashrc ` :
13
13
``` bash
14
14
scw () {
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 " $@ "
16
16
}
17
17
export -f scw
18
18
```
19
19
20
20
Or if you use ZSH, add the following in your ` ~/.zshrc ` :
21
21
``` zsh
22
22
scw () {
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 $@
24
24
}
25
25
```
26
26
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
+
27
39
## Autocompletion
28
40
29
41
You 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
44
56
And in your ` ~/.bashrc ` you can add:
45
57
``` bash
46
58
scw () {
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 " $@ "
48
60
}
49
61
export -f scw
50
62
51
63
_scw () {
52
64
_get_comp_words_by_ref -n = cword words
53
65
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[@]} " )
55
67
COMPREPLY=($output )
56
68
# apply compopt option and ignore failure for older bash versions
57
69
[[ $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
66
78
If running with Podman and SELinux in enforcing mode, one must use the : Z option when mounting the configuration file.
67
79
For instance:
68
80
``` 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
70
82
```
0 commit comments