Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker容器中的流浪汉不工作(尝试将流浪汉文件脱机)_Docker_Vagrant_Gitlab Ci_Static Code Analysis - Fatal编程技术网

Docker容器中的流浪汉不工作(尝试将流浪汉文件脱机)

Docker容器中的流浪汉不工作(尝试将流浪汉文件脱机),docker,vagrant,gitlab-ci,static-code-analysis,Docker,Vagrant,Gitlab Ci,Static Code Analysis,我只是不明白。。。我正在尝试创建一个安装了vagrant的docker容器,以在Gitlab CI管道中过滤我的vagrant文件。但我得到的只是这个结果: $ cd src/main/kube-cluster && vagrant validate ==> vagrant: A new version of Vagrant is available: 2.2.16 (installed version: 2.2.6)! ==> vagrant: To upgrade

我只是不明白。。。我正在尝试创建一个安装了vagrant的docker容器,以在Gitlab CI管道中过滤我的vagrant文件。但我得到的只是这个结果:

$ cd src/main/kube-cluster && vagrant validate
==> vagrant: A new version of Vagrant is available: 2.2.16 (installed version: 2.2.6)!
==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
有关完整管道,请参见

我的Dockerfile相当简单

FROM ubuntu:focal
LABEL maintainer="sommerfeld.sebastian@gmail.com"

# Avoid beeing stuck at tzdata
ENV TZ="Europe/Berlin"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update \
    && apt-get install -y --no-install-recommends virtualbox=6.1.6-dfsg-1 virtualbox-qt=6.1.6-dfsg-1 virtualbox-dkms=6.1.6-dfsg-1 \
    && vboxmanage --version \
    && apt-get install -y --no-install-recommends ca-certificates=20210119~20.04.1 \
    && apt-get install -y --no-install-recommends curl=7.68.0-1ubuntu2.5 \
    && apt-get install -y --no-install-recommends libcurl4=7.68.0-1ubuntu2.5 \
    && curl -O https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.deb \
    && apt-get install -y --no-install-recommends ./vagrant_2.2.6_x86_64.deb \
    && vagrant --version \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
但无论如何,我尝试,我总是从我的管道得到大约的结果。有人知道我如何修复自己的形象吗


或者,我也可以选择另一种方式来删除我的Vagrant文件。

在这样的容器中执行Vagrant provider less会变得很棘手,即使在这种情况下,提供程序并不重要。kubectl清单验证也存在类似的问题。这里最好的替代方法是ruby/rubocop linting,它提供了一些验证措施,并且在容器中更容易实现。。。显然,您可以使用vagrant validate和--ignore provider标志。那你就不需要医生了。因此,我从图像中删除了virtualbox。缺点是跳过了特定于提供程序的设置。但是,这种方式似乎很简单,应该足够了。看见