-
-
Save fran0x/a0af37a880164da87198 to your computer and use it in GitHub Desktop.
FROM centos:6.6 | |
MAINTAINER "Francisco Lopez" [email protected] | |
# 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"] |
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
Greenplum is now open source, Maybe this is best time to dockerize it?