Skip to content

Add support for ssh key in docker setup #3340

@fjammes

Description

@fjammes

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Command attempted

scw init -p newprofile access-key=XXX secret-key=YYY organization-id=ZZZ  project-id=TTT

Expected Behavior

scw should handle correctly user ssh key and print to stdout something like:

Looks like your local SSH key ~/.ssh/id_rsa.pub is already present in your Scaleway account.

Actual Behavior

An error on ssh key management occurs and is displayed on scw stdout (see last line):

...

Creating new config

To improve this tool we rely on diagnostic and usage data.
Sending such data is optional and can be disabled at any time by running "scw config set send-telemetry=false".
Do you want to send usage statistics and diagnostics? (Y/n): Y

To fully enjoy Scaleway CLI we recommend you install autocomplete support in your shell.
Do you want to install autocomplete? (Y/n): Y
Config saved at /root/.config/scw/config.yaml:
profiles:
  newprofile:
    ...


To enable autocomplete, scw needs to update your shell configuration.
What type of shell are you using (default: bash): zsh

To enable autocomplete we need to append to /root/.zshrc the following lines:

	# Scaleway CLI autocomplete initialization.
	eval "$(/scw autocomplete script shell=zsh)"

Do you want to proceed with these changes? (Y/n): Y


✅ Initialization completed with success.
  Except for SSH key: could not find an SSH key at ~/.ssh/id_rsa.pub

More info

scw version
Version    2.19.0
BuildDate  2023-07-24T02:32:19PM
GoVersion  go1.20.4
GitBranch  HEAD
GitCommit  849a2898
GoArch     amd64
GoOS       linux

A solution to fix this issue is to use:

scw() {
    docker run -it --rm -v $HOME/.config/scw:/root/.config/scw -v $HOME/.ssh:/root/.ssh scaleway/cli:"$scw_version" "$@"
}

If this solution is correct documentation should be updated accordingly.

Metadata

Metadata

Assignees

Labels

buginstanceInstance issues, bugs and feature requestspriority:highestBugs filled by customers, security issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions