Run h2o with Docker

23

I heard Kazuho's "H2O - the optimized HTTP server" at the HTTP2Conference and wanted to try h2o, so I ran it with Docker.

Create an image

Dockerfile is as follows.

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"]

After that, build and create an image below.

$ docker build -t tcnksm/h2o .

Move the sample

Let's run it using the examples configuration file.Specify the configuration file as the launch argument.

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

If you are running with boot2docker, you can access it below.

$ curl $(boot2docker ip):8080

reference

Share:
23
Author by

Updated on November 04, 2014