Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Dockerfile to run phc and php2py #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Build PHP 5.x compiler and Python translater container

# put your code in code/in.php
# run docker below and read the output in code/out.py
#
# docker build . -t php2py
# docker run \
# --rm \
# --user $(id -u):$(id -g) \
# -v `pwd`/code/:/code \
# php2py


FROM ubuntu:14.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

RUN apt-get install -y \
build-essential \
libgc-dev \
libboost1.55-all-dev \
graphviz \
autoconf \
git \
php5-cli

WORKDIR /opt

RUN git clone https://github.com/taichino/php2py
RUN git clone https://github.com/pbiggar/phc

WORKDIR /opt/phc

RUN touch src/generated/* Makefile.in configure Makefile libltdl/aclocal.m4 libltdl/Makefile.in libltdl/configure libltdl/Makefile

RUN ./configure
RUN make -j4
RUN make install
RUN ldconfig

WORKDIR /opt/php2py

CMD phc --dump-xml=ast /code/in.php > /code/out.xml && \
/opt/php2py/php2py.php /code/out.xml > /code/out.py