在Mac OS X上构buildOracle Docker镜像失败,“此系统不符合交换空间的最低要求”。

我在OS X上使用Docker Community Edition 17.03.0-ce-mac2(15654)。

我正在使用这些(官方)oracle docker文件

我正在使用oracle-xe-11.2.0-1.0.x86_64.rpm.zip作为我的安装二进制文件。

当我跑步

:dockerfiles $ pwd .../oracle/docker-images/OracleDatabase/dockerfiles :dockerfiles $ ./buildDockerImage.sh -v 11.2.0.2 -x 

我得到这个错误:

 Archive: oracle-xe-11.2.0-1.0.x86_64.rpm.zip creating: Disk1/ creating: Disk1/upgrade/ inflating: Disk1/upgrade/gen_inst.sql creating: Disk1/response/ inflating: Disk1/response/xe.rsp inflating: Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm This system does not meet the minimum requirements for swap space. Based on the amount of physical memory available on the system, Oracle Database 11g Express Edition requires 2048 MB of swap space. This system has 1023 MB of swap space. Configure more swap space on the system and retry the installation. error: %pre(oracle-xe-11.2.0-1.0.x86_64) scriptlet failed, exit status 1 error: oracle-xe-11.2.0-1.0.x86_64: install failed Removing intermediate container 86bb92ebf0e5 

这工作上周。 我不记得当时我做了什么不同的事情。

我需要做些什么来解决?

问题是,托pipeos x上的虚拟机将swap设置为1G。 当我在这里发现“ramonpires”的回答时,它向我清楚,我需要将交换添加到该基础虚拟机。 在那篇文章中的指示让我大部分的方式,但我不得不添加一个最后一步,以使其工作。 那么完整的解决scheme:

 screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty username:root password:[empty] close session:Ctrl+ad free -m 

这告诉你有多less可用的交换。 检查它是不到2G。

 dd if=/dev/zero of=/var/swap.file count=2000000 bs=1024 chmod go= /var/swap.file mkswap /var/swap.file echo "/var/swap.file swap swap defaults 0 0" >> /etc/fstab swapon -a 

链接解决scheme中缺less最后一行。 现在运行

 free -m 

确保你有2G以上的交换空间,然后重新运行

 :dockerfiles $ ./buildDockerImage.sh -v 11.2.0.2 -x