八面体与Alpine Linux的Docker化

我不确定这是否是正确的地方问这个问题。 我会尽力。 如果不合规请closures。

我遇到的问题是,使用octopress dockerizing来在github.io上发布内容,特别是在Alpine Linux上。

这是我的Dockerfile:

FROM alpine:edge MAINTAINER Emanuele Ianni <dierre@gmail.com> ENV BUILD_PACKAGES bash curl-dev build-base git ENV RUBY_PACKAGES ruby ruby-dev ruby-io-console ruby-bundler ENV EXECJS_DEPENDENCY nodejs ENV GIT_URL https://github.com/invasionofsmallcubes/invasionofsmallcubes.github.io.git # Update and install all of the required packages. # At the end, remove the apk cache RUN apk update && \ apk upgrade && \ apk add $BUILD_PACKAGES && \ apk add $RUBY_PACKAGES && \ apk add $EXECJS_DEPENDENCY && \ rm -rf /var/cache/apk/* # RUN gem install --no-rdoc --no-ri posix-spawn -v 0.3.11 RUN gem install --no-rdoc --no-ri execjs # cloning existing octopress repo WORKDIR ~ RUN git clone $GIT_URL octopress WORKDIR octopress RUN gem install --no-rdoc --no-ri bundler 

它打破了,这是第12步RUN bundle install

  Installing posix-spawn 0.3.6 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /usr/bin/ruby -r ./siteconf20150914-5-1oxh9qm.rb extconf.rb creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling posix-spawn.c In file included from /usr/include/ruby-2.2.0/ruby/ruby.h:24:0, from /usr/include/ruby-2.2.0/ruby.h:33, from posix-spawn.c:14: /usr/include/ruby-2.2.0/x86_64-linux-musl/ruby/config.h:17:0: warning: "_GNU_SOURCE" redefined #define _GNU_SOURCE 1 ^ posix-spawn.c:3:0: note: this is the location of the previous definition #define _GNU_SOURCE ^ posix-spawn.c: In function 'rb_posixspawn_pspawn': posix-spawn.c:403:11: error: 'POSIX_SPAWN_USEVFORK' undeclared (first use in this function) flags |= POSIX_SPAWN_USEVFORK; ^ posix-spawn.c:403:11: note: each undeclared identifier is reported only once for each function it appears in Makefile:237: recipe for target 'posix-spawn.o' failed make: *** [posix-spawn.o] Error 1 make failed, exit code 2 Gem files will remain installed in /usr/lib/ruby/gems/2.2.0/gems/posix-spawn-0.3.6 for inspection. Results logged to /usr/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0/posix-spawn-0.3.6/gem_make.out An error occurred while installing posix-spawn (0.3.6), and Bundler cannot continue. Make sure that `gem install posix-spawn -v '0.3.6'` succeeds before bundling. The command '/bin/sh -c bundle install' returned a non-zero code: 5 

我没有安装更高版本的posix-spawn的问题,但这是捆绑安装所需的。

如果我使用Ubuntu运行该文件,我没有这个错误:

 Installing syntax 1.0.0 Installing maruku 0.6.1 Installing posix-spawn 0.3.6 with native extensions Installing yajl-ruby 1.1.0 with native extensions 

我已经安装了ruby-dev,所以我认为这已经足够了。 你知道有什么我可以检查吗?

Alpine Linux使用musl libc而不是glibc,这有时会导致边缘情况的问题。 在rtomayko / posix-spawn见问题#54 。

如果你坚持坚持使用阿尔卑斯山,我可以想出几个可能的解决办法。 首先是检查这个实验包在阿尔卑斯山posix-spawn。 您必须添加边缘/testing存储库,当然,在http://dl-4.alpinelinux.org/alpine/edge/testing/x86_64/

或者,你可以安装一个阿尔卑斯山实验glibc包。 下面是一个用于安装Java 8 JDK的例子,以便您开始使用: https : //github.com/sillelien/base-java/blob/master/Dockerfile (特别是第10-16行)。

当然,如果你不能得到任何其他的东西,你总是可以使用debian:jessie (或者Ubuntu)而不是Alpine。 这不会是世界末日,但作为一名阿尔卑斯风扇,我会理解你是否想继续尝试解决方法让Octopress在Alpine上工作。

希望这可以帮助!

Interesting Posts