本镜像在NodeJS和Alpine镜像基础上构建Ruby环境,用途直观明了。
它是Rails应用开发者的理想基础镜像,可通过预构建的NodeJS V8引擎替代therubyracer gem,避免相关依赖问题。
希望能为后续开发者提供帮助。
标签与版本
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.1.9/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.3/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.4/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.5/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.6/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.7/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.8/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.9/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.2.10/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.3.0/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.3.1/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.3.3/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.3.4/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.3.5/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.3.6/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.3.7/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.4.1/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.4.2/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.4.4/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.5.0/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.5.1/Dockerfile
- https://github.com/Daniel-ltw/ruby-node-alpine/blob/master/2.6.1/Dockerfile
Gem依赖处理
安装Gem时,部分Gem存在特定原生依赖,需先添加对应的Alpine包:
bash
apk --update add ${packages}
已知依赖对应关系:
- ffi: libffi-dev
- nokogiri: libxml2 libxslt libxml2-dev libxslt-dev
- rmagick: imagemagick imagemagick-dev
- raindrops: linux-headers
- pg: postgresql-client postgresql-dev
注:原生编译还需以下依赖:
支持的Docker版本
本镜像官方支持Docker 1.11.2版本,对1.6及以上旧版本提供尽力支持。
贡献指南
欢迎贡献新功能、修复或更新(无论大小)。我们会尽快处理收到的Pull Request。
部署示例
查看镜像版本
bash
docker run -it --rm docker.xuanyuan.run/scardon/ruby-node-alpine ruby -v && node -v
作为基础镜像使用(Dockerfile示例)
dockerfile
FROM scardon/ruby-node-alpine:latest
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle install
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
CMD ["rails", "server", "-b", "0.0.0.0"]