0

我正在尝试在 OS X 10.9 上设置基于 Vagrant + Docker 的开发环境。第一步是为 MariaDB 10 创建一个容器。但是,由于某种原因,Docker 映像不会在我的 OS X 机器上的 boot2docker VM 中构建,即使它在 Ubuntu 14.04 上运行良好。

我试过 boot2docker 1.2 和 Docker 1.2 和 1.3 和 1.3 以及从 0.9.10 到 0.9.15 的所有 Phusion 图像,ubuntu:latest 和 Vagrant 1.6 和 1.6.5 没有运气。MariaDB 5.5 版在 OS X 和 Ubuntu 上都可以正常安装,但我需要更新的版本。

我对这个没有想法。为什么它在 Docker 中有效,但在 boot2docker 中无效,是否可以解决该问题?

我的Vagrantfile样子是这样的:

VAGRANTFILE_API_VERSION = "2"
ENV["VAGRANT_DEFAULT_PROVIDER"] = "docker"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "db" do |db|
    db.vm.provider "docker" do |d|
      d.name = "db"
      d.build_dir = "db"
    end
  end
end

Dockerfile以及相关目录中的随附db内容:

FROM phusion/baseimage:0.9.15

ENV HOME /root
CMD ["/sbin/my_init"]

RUN apt-get install software-properties-common
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
RUN add-apt-repository 'deb http://mirror.stshosting.co.uk/mariadb/repo/10.0/ubuntu trusty main'
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

vagrant up终止于:

...
Unpacking mariadb-server (10.0.14+maria-1~trusty) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up libaio1:amd64 (0.3.109-4) ...
Setting up libreadline5:amd64 (5.2+dfsg-2) ...
Setting up libdbi-perl (1.630-1) ...
Setting up libhtml-template-perl (2.95-1) ...
Setting up libmysqlclient18 (10.0.14+maria-1~trusty) ...
Setting up libdbd-mysql-perl (4.025-1) ...
Setting up libmariadbclient18 (10.0.14+maria-1~trusty) ...
Setting up mariadb-client-core-10.0 (10.0.14+maria-1~trusty) ...
Setting up mariadb-client-10.0 (10.0.14+maria-1~trusty) ...
Setting up mariadb-server-core-10.0 (10.0.14+maria-1~trusty) ...
Setting up mariadb-server-10.0 (10.0.14+maria-1~trusty) ...
invoke-rc.d: policy-rc.d denied execution of stop.
dpkg: error processing package mariadb-server-10.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.0 (= 10.0.14+maria-1~trusty); however:
  Package mariadb-server-10.0 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 mariadb-server-10.0
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
4

1 回答 1

0

当我的 vagrant virtual mashine 的RAM 非常低时,我发现了这个错误。

于 2015-10-29T16:29:23.977 回答