Azure devops Docker容器内的通道scw初始

Azure devops Docker容器内的通道scw初始,azure-devops,dockerfile,Azure Devops,Dockerfile,我正在尝试将Scaleway CLI安装为docker映像的一部分,我正在构建该映像以运行Azure管道 我的Dockerfile如下所示: FROM ubuntu:18.04 # To make it easier for build and release pipelines to run apt-get, # configure apt to not require confirmation (assume the -y argument by default) ENV DEBIAN_F

我正在尝试将Scaleway CLI安装为docker映像的一部分,我正在构建该映像以运行Azure管道

我的Dockerfile如下所示:

FROM ubuntu:18.04

# To make it easier for build and release pipelines to run apt-get,
# configure apt to not require confirmation (assume the -y argument by default)
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
        ca-certificates \
        curl \
        jq \
        git \
        iputils-ping \
        libcurl4 \
        libicu60 \
        libunwind8 \
        netcat\
        docker.io \
        s3cmd

# Install Scaleway CLI
RUN curl -o /usr/local/bin/scw -L "https://github.com/scaleway/scaleway-cli/releases/download/v2.1.0/scw-2-1-0-linux-x86_64"
RUN chmod +x /usr/local/bin/scw

# Add config for Scaleway CLI
RUN mkdir -p ./config
RUN mkdir -p ./config/scw
COPY ./config/config.yaml $HOME/.config/scw/config.yaml
RUN scw init

# Add private key for SSH connections
COPY ./config/id_rsa $HOME/.ssh/id_rsa

# Config s3cmd
COPY ./config/.s3cfg $HOME/.s3cfg

WORKDIR /azp

COPY ./start.sh .
RUN chmod +x start.sh

CMD ["./start.sh"]
关键部分是:

# Install Scaleway CLI
RUN curl -o /usr/local/bin/scw -L "https://github.com/scaleway/scaleway-cli/releases/download/v2.1.0/scw-2-1-0-linux-x86_64"
RUN chmod +x /usr/local/bin/scw

# Add config for Scaleway CLI
RUN mkdir -p ./config
RUN mkdir -p ./config/scw
COPY ./config/config.yaml $HOME/.config/scw/config.yaml
RUN scw init
上面引用的
config.yaml
文件如下所示(当然减去实际值):

access\u键:
密钥:
默认\u组织\u id:
默认\u项目\u id:
默认_区域:nl ams
默认_区域:nl-ams-1
但是,当它执行
RUN scw init
时,输出是
无效的电子邮件或密钥:“”

我尝试过根本不运行
scw init
,但是调用
scw
失败,说

需要访问密钥

详细信息:可以使用命令“scw init”初始化访问密钥

初始化后,有三种方式提供访问密钥:

  • 使用Scaleway config文件,在access_key:/root/.config/scw/config.yaml
  • 使用SCW_ACCESS_KEY环境变量
请注意,最后一个方法具有最高优先级

更多信息:

提示:您可以在此处获取凭据:

诚然,这是我见过的最好的错误消息之一,但对我没有帮助。我将尝试使用环境变量方法,我怀疑这可能会起作用,但我仍然想知道这个config.yaml文件有什么问题


最后。。。比我更具代表性的人需要创建标记“scaleway”。当标签不存在时,很难参考实际的技术问题。

一个简单的问题,您是否成功地从Visual Studio构建了此Dockerfile?@MerlinLiang MSFT,我使用的是Visual Studio代码,实际上,因此我一直在使用docker image build-t docker:latest从命令行构建它。,并且没有,它不会生成,因为它在
RUN scw init
行失败,错误在文章中描述。
access_key: <key>
secret_key: <secret>
default_organization_id: <orgId>
default_project_id: <projectId>
default_region: nl-ams
default_zone: nl-ams-1