Add instructions to build a docker image for pgloader.

The current instructions build SBCL then pgloader all from sources in a
debian VM. It might be a good idea to maintain a debian+SBCL docker
image and build pgloader on top of that.
This commit is contained in:
Dimitri Fontaine 2014-11-30 18:52:35 +01:00
parent cd52654e3d
commit b9e26ea460

View File

@ -83,3 +83,68 @@ image, at compile time. This defaults to 4 GB.
make DYNSIZE=1024
Now the `./build/bin/pgloader` that you get only uses 1GB.
## Building a docker image
We start with a `debian` image:
docker run -it debian bash
And then run the following steps:
# apt-get update
# apt-get install -y wget curl make git bzip2 time libzip-dev openssl-dev
# apt-get install -y patch unzip libsqlite3-dev gawk freetds-dev
# useradd -m -s /bin/bash dim
# su - dim
Install a binary version on SBCL, which unfortunately has no support for
core compression, so only use it to build another SBCL version from sources
with proper options:
$ mkdir sbcl
$ cd sbcl
$ wget http://prdownloads.sourceforge.net/sbcl/sbcl-1.2.6-x86-64-linux-binary.tar.bz2
$ wget http://prdownloads.sourceforge.net/sbcl/sbcl-1.2.6-source.tar.bz2?download
$ mv sbcl-1.2.6-source.tar.bz2\?download sbcl-1.2.6-source.tar.bz2
$ tar xf sbcl-1.2.6-x86-64-linux-binary.tar.bz2
$ tar xf sbcl-1.2.6-source.tar.bz2
$ exit
Install SBCL as root
# cd /home/dim/sbcl/sbcl-1.2.6-x86-64-linux
# bash install.sh
Now back as the unprivileged user (dim) to compile SBCL from sources:
# su - dim
$ cd sbcl/sbcl-1.2.6
$ sh make.sh --with-sb-core-compression --with-sb-thread > build.out 2>&1
$ exit
And install the newly compiled SBCL as root:
# cd /home/dim/sbcl/sbcl-1.2.6
# sh install.sh
Now build pgloader from sources:
# su - dim
$ git clone https://github.com/dimitri/pgloader
$ cd pgloader
$ make
$ ./build/bin/pgloader --help
$ exit
Now install pgloader in `/usr/local/bin` to make it easy to use:
# cp /home/dim/pgloader/build/bin/pgloader /usr/local/bin
# pgloader --version
Commit the docker instance and push it, from the host:
$ docker login
$ docker ps -l
$ docker commit <id> dimitri/pgloader-3.1.cd52654
$ docker push dimitri/pgloader-3.1.cd52654