- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在尝试使用 docker-compose 在 AWS CodeBuild 上设置自动化 Rails 测试,但它出错了。
在 buildspec.yml 中:
phases:
build:
commands:
- docker-compose up -d
[Container] 2018/10/23 11:27:56 Running command docker-compose up -d
Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
[Container] 2018/10/23 11:27:56 Command did not exit successfully docker-compose up -d exit status 1
[Container] 2018/10/23 11:27:56 Running command echo This always runs even if the install command fails
This always runs even if the install command fails
[Container] 2018/10/23 11:27:56 Phase complete: BUILD Success: false
[Container] 2018/10/23 11:27:56 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: docker-compose up -d. Reason: exit status 1
大概我需要安装 docker 并启动服务,但这将在 Docker 中运行 Docker,并且需要以特权权限启动构建服务器。我只能看到用于构建 Docker 镜像的示例,但我只是尝试使用它来设置运行测试的环境。
感谢@mferre 回答这个问题。 Docker-compose 确实是完全支持的,不需要做任何特别的事情。关键是在 AWS CodeBuild 控制台(或通过 API 进行设置)时在“环境”部分选择一个 Docker 镜像:
也可以为现有项目指定 - 从 Build/Build Projects 中选择项目,然后从 Edit 菜单中选择 Environments。这使您可以指定图像:
您可以使用任何其他镜像并在 buildspec.yml
中编写 Docker 设置脚本,但最简单的方法是使用上述官方 Docker 镜像。以此为容器,docker 和 docker-compose 已预先安装,因此 docker-compose “正常工作”。如果项目在其根目录中有 docker-compose.yml
文件,则 buildspec.yml
可以像立即运行一样简单:
version: 0.2
phases:
build:
commands:
- docker-compose up -d
最佳答案
好的,我想通了!
您需要在 CodeBuild 容器上启用“特权访问”。这将允许您与 docker cli 交互。
然后将这两行添加到安装命令中:
- nohup/usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver =覆盖2&
`
- 超时 15 sh -c "直到 docker info;做回声。; sleep 1;完成"
例如:
version: 0.2
phases:
install:
commands:
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
pre_build:
commands:
- docker build -t helloworld .
build:
commands:
- docker images
- docker run helloworld echo "Hello, World!"
关于ruby-on-rails - 如何在 AWS CodeBuild 上运行 docker-compose?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52949413/
我使用以下命令使用 Composer 删除了一个包。 composer remove sjparkinson/static-review 以上命令从 composer.json 中删除条目文件但 co
我刚刚开始使用 Composer 功能,你告诉它查看本地目录的依赖关系,这样你就可以开发一个库和一些并行使用该库的东西,而不必一直推送到 git 来更新,这是惊人的。例如 "repositories"
composer 和有什么区别和 composer.phar ? 例子: composer install composer.phar install 我一直看到使用 composer.phar 编写
阅读docker-compose -h或this official manual的帮助将为我们提供--project-directory PATH选项 docker-compose [-f ...]
我已经使用他们的安装指南在我的 Linux/Apache 服务器上的根目录(这是默认选择)中成功安装了 Composer。到目前为止,一切都非常简单,除了我必须进行的一个 php.ini 调整( de
在我的 composer.json配置文件,我有: "require": { "zendframework/zend-log" : "~2.3", }, "require-dev": {
从 Composer 安装此软件包后,我想复制位于软件包内的一些文件。 实际上,我希望在从 Composer 安装或更新软件包后,将下载的软件包中可能存在的某个文件复制到另一个目录。我用 script
我对码头公司还是个新手。我使用的是最新版本的Python、Django和Docker。我已经在这个项目上工作了两周了,我已经创建了docker-compose.yml文件,并且已经构建了我的docke
我正在尝试使用 composer 安装一个 github 项目并得到以下错误 Composer [UnexpectedValueException]您的 github.com 的 Github oau
我开发 Symfony 包的工作流程如下: 安装 Symfony 为新包创建一个 git repo,在其中放置一个 composer.json 文件 需要顶级 composer.json 中的新包,使
我正在尝试使用 composer 安装 github 项目并收到以下错误 Composer [UnexpectedValueException] 您用于 github.com 的 Github oau
我们在项目中使用了 composer。当我开发和/或向项目提交任何内容时,我通常应该使用 composer install;更新依赖项只是偶尔进行。 我们还使用 https://github.com/
我在 youtube 上学会了这个抽屉 https://www.youtube.com/watch?v=JLICaBEiJS0&list=PLQkwcJG4YTCSpJ2NLhDTHhi6XBNfk9
我知道在 onClick 中调用可组合函数是不可能的。 @Composable 调用只能在 @Composable 函数的上下文中发生 撰写版本 - alpha06 但我坚持以下要求。 要求是, 在
这是我的 docker-compose.yml 文件: version: '3.1' services: a: image: tutum/hello-world b: imag
创建Asset实例时是否有auto_increment字段类型可用。例如, Assets ID 应该是自动生成的字段,应该在运行时创建,而不是在应用程序级别提及该值。我可以通过创建一个交易处理器函数来
在 Composer 项目中,我必须添加一个库,它没有 composer.json 并且不使用命名空间。因此,我调整了项目的 composer.json 以添加库: { [...] "
当 vendor 目录中已经有一些组件被下载时.. 在上面运行 install 以及运行 update 时有什么影响? 最佳答案 所以我有同样的问题,这是我发现的: composer install
尝试运行 composer install 时出现此错误。我已经运行了 composer update,我正在尝试使用这个最新的锁定文件进行安装。没有任何帮助。 Loading composer re
当我尝试做: $ sudo php composer.phar update 我收到此警告: Warning: This development build of composer is over 3
我是一名优秀的程序员,十分优秀!