LoginSignup
1

More than 5 years have passed since last update.

nginx mrubyとHTTP2対応のDockerfile

Posted at

概要

Dockerfileでngx mrubyとhttp2対応する
OpensslはUbuntu 16.10なら1.0.2gなのでsrc展開不要、openss-devを忘れなければOK

Dockerfile

FROM ubuntu:16.10
LABEL  maintainer "Ryo Tamura Yapodu Inc, <tamura@yapodu.co.jp>"

RUN apt-get -y update
RUN apt-get -y install sudo openssh-server
RUN apt-get -y install git
RUN apt-get -y install curl
RUN apt-get -y install rake
RUN apt-get -y install ruby ruby-dev
RUN apt-get -y install bison
RUN apt-get -y install libcurl4-openssl-dev
RUN apt-get -y install libhiredis-dev
RUN apt-get -y install libmarkdown2-dev
RUN apt-get -y install libcap-dev
RUN apt-get -y install libcgroup-dev
RUN apt-get -y install make
RUN apt-get -y install libpcre3 libpcre3-dev
RUN apt-get -y install libmysqlclient-dev
RUN apt-get -y install build-essential
RUN apt-get -y install ruby-build

WORKDIR /usr/local/src
  RUN wget http://nginx.org/download/nginx-1.13.7.tar.gz \
  && tar zxvf ./nginx-1.13.7.tar.gz

WORKDIR /usr/local/src
  RUN git clone git://github.com/matsumoto-r/ngx_mruby.git \
  && cd ngx_mruby \
  && git submodule init \
  && git submodule update \
  && ./configure --with-ngx-src-root=/usr/local/src/nginx-1.13.7 \
  && make build_mruby \
  && make generate_gems_config

WORKDIR /usr/local/src
  RUN cd nginx-1.13.7 \
  && ./configure --prefix=/usr/local/nginx/ \
  && ./configure --add-module=../ngx_mruby --add-module=../ngx_mruby/dependence/ngx_devel_kit --prefix=/usr/local/nginx/ --with-http_ssl_module --with-http_v2_module  \
  && make \
  && make install

追加設定 or buid後作業

  • HTTP2はSSL通信なのでSSLの設定等を入れる
  • コンテナが1GBくらいあるので、ダイエットできるはず

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1