23
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Dockerでh2oを動かす

Last updated at Posted at 2014-11-03

HTTP2Conferenceにてkazuhoさんの"H2O - the optimized HTTP server"を聞いて,h2oを試したくなったので,Dockerで動かしてみた.

イメージを作成する

Dockerfileは以下.

FROM buildpack-deps

RUN apt-get update && apt-get install -y \
    cmake \
    && rm -rf /var/lib/apt/lists/*
    
RUN git clone https://github.com/h2o/h2o \
    && cd h2o \
    && git submodule update --init --recursive \
    && cmake . \
    && make h2o

WORKDIR /h2o    
ENTRYPOINT ["./h2o", "-c"]

あとは以下でビルドしてイメージを作成する.

$ docker build -t tcnksm/h2o .

サンプルを動かす

examplesの設定ファイルを使って動かしてみる.起動引数に設定ファイルを指定すればよい.

$ docker run --rm -p 8080:8080 tcnksm/h2o examples/h2o.conf

boot2dockerで動かしている場合は,以下でアクセスできる.

$ curl $(boot2docker ip):8080

参考

23
23
0

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
23
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?