Skip to content

Instantly share code, notes, and snippets.

@frank-leap
Last active February 15, 2016 17:33
Show Gist options
  • Save frank-leap/a0af37a880164da87198 to your computer and use it in GitHub Desktop.
Save frank-leap/a0af37a880164da87198 to your computer and use it in GitHub Desktop.
Dockerfile for Greenplum SNE 4.2.6.1
FROM centos:6.6
MAINTAINER "Francisco Lopez" teraflopx@gmail.com
# update & upgrade packages
RUN yum update -y & yum upgrade -y
# install extra packages and basic tools (included some required for Greenplum installer)
RUN yum install -y epel-release git unzip which tar sed wget curl nano expect
# cleanup packages
RUN yum clean -all
# set password to SSH with root
RUN echo root:docker | chpasswd
# create admin user group and admin user
RUN groupadd -g 8000 gpadmin
RUN useradd -m -s /bin/bash -d /home/gpadmin -g gpadmin -u 8000 gpadmin
RUN echo "greenplum" | passwd gpadmin --stdin
# create data directories (master and 2 segments)
RUN mkdir -p /data/gpmaster /data/gpseg1 /data/gpseg2 /data/greenplum
RUN chown -R gpadmin:gpadmin /data
# install Greenplum
COPY bin/greenplum-db-4.2.6.1-build-1-RHEL5-x86_64.zip greenplum-db-4.2.6.1-build-1-RHEL5-x86_64.zip
RUN unzip greenplum-db-4.3.2.0-build-1-RHEL5-x86_64.zip -d /
COPY bin/greenplum.sh greenplum.sh
RUN sh greenplum.sh
# housekeeping (remove non necessary files)
# TO BE COMPLETED
# configure system
COPY config/sysctl.conf /tmp/sysctl.conf
RUN cat /tmp/sysctl.conf >> /etc/sysctl.conf
# next line is not working; it seems the only option is tuning the kernel outside this Dockerfile (using docker run -w)
RUN sysctl -p /etc/sysctl.conf
COPY config/limits.conf /tmp/limits.conf
RUN cat /tmp/limits.conf >> /etc/security/limits.conf
USER gpadmin
# configure Greenplum environment
RUN echo "source /data/greenplum/greenplum_path.sh" > /home/gpadmin/.bash_profile
RUN echo "export MASTER_DATA_DIRECTORY=/data/gpmaster/gpsne-1" >> /home/gpadmin/.bash_profile
#RUN source /home/gpadmin/.bash_profile
RUN echo "$(hostname)" > /home/gpadmin/sne_hostlist
# next line is not working; why?
RUN gpssh-exkeys -f /home/gpadmin/sne_hostlist
#RUN gpcheckos -f /home/gpadmin/sne_hostlist
COPY config/sne_gpinit /home/gpadmin/sne_gpinit
RUN gpinitsystem -c /home/gpadmin/sne_gpinit
# expose ports and data folder
EXPOSE 22 5432
VOLUME ["/data"]
# start Greenplum
ENTRYPOINT ["/bin/bash"]
CMD ["gpstart"]
@frank-leap
Copy link
Author

Note: Greenplum is not open source but the installer can be downloaded from https://network.pivotal.io/products/pivotal-gpdb for testing purposes. It requires a user account to be created in Pivotal website.

@frank-leap
Copy link
Author

At the moment I am stuck with two problems:

  • Kernel tuning (should I use 'docker run -w'? should I tune this in the Vagrant host instead?)
  • SSH key exchange (not sure what´s going on here yet)

@Mironor
Copy link

Mironor commented Oct 12, 2015

Hi teraflopx,

you seem to be the only one (over the internet) who tried to create a docker image for greenplum.
Have you succeed? Or this is the final version of the dockerfile that you have?

@korczis
Copy link

korczis commented Nov 3, 2015

Greenplum is now open source, Maybe this is best time to dockerize it?

@kevinmtrowbridge
Copy link

Hi guys,

Hey, I have been able to "dockerize" Greenplum database in "singlenode" mode, just for testing purposes. Thanks for your Dockerfile, it was a light in the darkness to me, when I started last week.

Here I have placed the "Dockerfile build" repo on Github:
https://github.com/kevinmtrowbridge/greenplumdb_singlenode_docker

You'll notice some gross hacks in my version (for example, this choice bit: su gpadmin -l -c "gpstart -a --verbose" && sleep 86400 # HACK: it's difficult to get Docker to attach to the GPDB process(es) ... so, instead attach to process "sleep for 1 day") ... if anyone manages to figure out more elegant ways to do these things, I would love to hear about it! (I initially tried using "supervisord" but, it was just too much work for what I needed this for ...).

Best,
Kevin Trowbridge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment