DEV Community

D
D

Posted on

Docker で Hack

Facebook Hack試してみた。(Hello Worldだけ)
https://github.com/facebook/hhvm/wiki#installing-pre-built-packages-for-hhvm
自前のサーバーは汚したくないんで、Dockerでやってみた。

$ vim Dockerfile
Enter fullscreen mode Exit fullscreen mode
FROM ubuntu

RUN apt-get update
RUN apt-get install -y python-software-properties
RUN apt-get install -y wget
RUN add-apt-repository ppa:mapnik/boost
RUN wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
RUN echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list
RUN apt-get update
RUN apt-get install -y hhvm
Enter fullscreen mode Exit fullscreen mode
$ docker build -t hack .
.....
$ docker images

$ docker run -i -t hack bash
root@c5b48b4e3988:/# vi helloworld.hh
Enter fullscreen mode Exit fullscreen mode
<?hh
  echo "Hello World\n";
Enter fullscreen mode Exit fullscreen mode
root@c5b48b4e3988:/# hhvm helloworld.hh
Hello World
root@c5b48b4e3988:/# 
Enter fullscreen mode Exit fullscreen mode

ハマったところ!

<?hh
  echo "Hello World\n";
?>
Enter fullscreen mode Exit fullscreen mode

HipHop Fatal error: syntax error, unexpected T_HH_ERROR, expecting $end in /hellworld.hh on line 2

?> 閉じカッコを書くと上のエラーが出る

Top comments (0)