Skip to content

Commit

Permalink
Build PHP for Multiple Stacks fix #50
Browse files Browse the repository at this point in the history
Build PHP version in Docker containers using our Stack images instead
of inside Vagrant VMs that have to be maintained to match the Stack
run-time environment seperately.

Additionally the `Makefile` and `$STACK/Dockerfile`s allow to build
each PHP version for each Stack and can also be extended easily for
future Stacks.
  • Loading branch information
pst committed Nov 16, 2015
1 parent a10bb60 commit 8047f59
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 73 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
.vagrant/
build/buildpack-php/*
build/.vagrant/
build/dist/*
20 changes: 20 additions & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
all: pinky trinity

pinky-prepare:
docker build -t pinkyphpbuild:latest Pinky

pinky-build:
docker run -e "STACK=pinky" -v $(shell pwd):/vagrant -ti pinkyphpbuild:latest /vagrant/php-build.sh $(version)

pinky: pinky-prepare pinky-build

trinity-prepare:
docker build -t trinityphpbuild:latest Trinity

trinity-build:
docker run -e "STACK=trinity" -v $(shell pwd):/vagrant -ti trinityphpbuild:latest /vagrant/php-build.sh $(version)

trinity: trinity-prepare trinity-build

clean:
rm -rf dist/*
19 changes: 19 additions & 0 deletions build/Pinky/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM localhost:5000/cloudcontrol/ccpinky

MAINTAINER cloudControl

# Install packages required to build PHP that are not in the runtime stack
RUN apt-get update && apt-get install -y \
autoconf \
freetds-dev \
libbison-dev \
libicu-dev \
libmcrypt-dev \
libreadline-dev \
re2c

# Set symlinks for libsybdb so the PHP build can find it
RUN ln -f -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib/libsybdb.a \
&& ln -f -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so

CMD ["/bin/bash"]
23 changes: 21 additions & 2 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# Build php

vagrant up build
vagrant ssh build -c 'sudo /vagrant/php-build.sh VERSION'
Building PHP requires a working Docker setup with the latest stack images
available. The Makefile does take care of building the docker container and
run the PHP buildscript.

## Build all Stacks

```
make version=VERSION # e.g. php-5.6.12
```

## Build a specific stack

```
make STACK version=VERSION # e.g. trinity
```

## Cleanup

```
make clean
```

## Builds

Expand Down
16 changes: 16 additions & 0 deletions build/Trinity/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM localhost:5000/cloudcontrol/trinity

MAINTAINER cloudControl

# Install packages required to build PHP that are not in the runtime stack
RUN apt-get update && apt-get install -y \
autoconf \
freetds-dev \
libbison-dev \
re2c

# Set symlinks for libsybdb so the PHP build can find it
RUN ln -f -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib/libsybdb.a \
&& ln -f -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so

CMD ["/bin/bash"]
16 changes: 0 additions & 16 deletions build/Vagrantfile

This file was deleted.

10 changes: 0 additions & 10 deletions build/libmemcached_sasl_memset.patch

This file was deleted.

4 changes: 3 additions & 1 deletion build/php-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ make -s install
cd ..

cd ${PHP_DIR}/..
tar cjf /vagrant/buildpack-php/${PHP_VERSION}.tar.bz2 ${PHP_VERSION}
mkdir -p /vagrant/dist/${STACK}
tar cjf /vagrant/dist/${STACK}/${PHP_VERSION}.tar.bz2 ${PHP_VERSION}
chmod -R 777 /vagrant/dist/${STACK}
41 changes: 0 additions & 41 deletions build/prepare-vm.sh

This file was deleted.

0 comments on commit 8047f59

Please sign in to comment.