FROM centos:6
MAINTAINER Dmitry Maslennikov <mrdaimor@gmail.com>
# update OS + dependencies & run Caché silent instal RUN yum -y update \ && yum -y install which tar hostname net-tools wget \ && yum -y clean all \ && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Moscow
ENV TMP_INSTALL_DIR=/tmp/distrib
ARG password="Qwerty@12" ARG cache=ensemble-2016.2.1.803.0
ENV ISC_PACKAGE_INSTANCENAME="ENSEMBLE" \ ISC_PACKAGE_INSTALLDIR="/opt/ensemble/" \ ISC_PACKAGE_UNICODE="Y" \ ISC_PACKAGE_CLIENT_COMPONENTS="" \ ISC_PACKAGE_INITIAL_SECURITY="Normal" \ ISC_PACKAGE_USER_PASSWORD=${password}
WORKDIR ${TMP_INSTALL_DIR}
COPY cache.key $ISC_PACKAGE_INSTALLDIR/mgr/
ADD $cache-lnxrhx64.tar.gz .
RUN wget -qO /dev/null --keep-session-cookies --save-cookies /dev/stdout --post-data="UserName=$WRC_USERNAME&Password=$WRC_PASSWORD" 'https://login.intersystems.com/login/SSO.UI.Login.cls?referrer=https%253A//wrc.intersystems.com/wrc/login.csp' \ | wget -O - --load-cookies /dev/stdin "https://wrc.intersystems.com/wrc/WRC.StreamServer.cls?FILE=/wrc/distrib/$cache-lnxrhx64.tar.gz" \ | tar xvfzC - .
ARG WRC_USERNAME=”username” ARG WRC_PASSWORD=”password”
RUN wget -O - "ftp://ftp.company.com/cache/$cache-lnxrhx64.tar.gz" \ | tar xvfzC - .
RUN ./$cache-lnxrhx64/cinstall_silent
RUN ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly
# Caché container main process PID 1 (https://github.com/zrml/ccontainermain) RUN curl -L https://github.com/zrml/ccontainermain/raw/master/distrib/linux/ccontainermain -o /ccontainermain \ && chmod +x /ccontainermain
RUN rm -rf $TMP_INSTALL_DIR
# Workaround for an overlayfs bug which prevents Cache from starting with <PROTECT> errors COPY ccontrol-wrapper.sh /usr/bin/ RUN cd /usr/bin \ && rm ccontrol \ && mv ccontrol-wrapper.sh ccontrol \ && chmod 555 ccontrol
#!/bin/bash # Work around a weird overlayfs bug where files don't open properly if they haven't been # touched first - see the yum-ovl plugin for a similar workaround if [ "${1,,}" == "start" ]; then find $ISC_PACKAGE_INSTALLDIR -name CACHE.DAT -exec touch {} \; fi /usr/local/etc/cachesys/ccontrol $@
docker info --format '{{.Driver}}'
EXPOSE 57772 1972
ENTRYPOINT ["/ccontainermain", "-cconsole", "-i", "ensemble"]
FROM centos:6 MAINTAINER Dmitry Maslennikov <Dmitry.Maslennikov@csystem.cz> # update OS + dependencies & run Caché silent instal RUN yum -y update \ && yum -y install which tar hostname net-tools wget \ && yum -y clean all \ && ln -sf /etc/locatime /usr/share/zoneinfo/Europe/Prague ARG password="Qwerty@12" ARG cache=ensemble-2016.2.1.803.0 ENV TMP_INSTALL_DIR=/tmp/distrib # vars for Caché silent install ENV ISC_PACKAGE_INSTANCENAME="ENSEMBLE" \ ISC_PACKAGE_INSTALLDIR="/opt/ensemble/" \ ISC_PACKAGE_UNICODE="Y" \ ISC_PACKAGE_CLIENT_COMPONENTS="" \ ISC_PACKAGE_INITIAL_SECURITY="Normal" \ ISC_PACKAGE_USER_PASSWORD=${password} # set-up and install Caché from distrib_tmp dir WORKDIR ${TMP_INSTALL_DIR} ADD $cache-lnxrhx64.tar.gz . # cache distributive RUN ./$cache-lnxrhx64/cinstall_silent \ && ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly \ # Caché container main process PID 1 (https://github.com/zrml/ccontainermain) && curl -L https://github.com/daimor/ccontainermain/raw/master/distrib/linux/ccontainermain -o /ccontainermain \ && chmod +x /ccontainermain \ && rm -rf $TMP_INSTALL_DIR WORKDIR ${ISC_PACKAGE_INSTALLDIR} # TCP sockets that can be accessed if user wants to (see 'docker run -p' flag) EXPOSE 57772 1972 ENTRYPOINT ["/ccontainermain", "-cconsole", "-i", "ensemble"]
docker build -t ensemble-simple .
docker build --build-arg password=SuperSecretPassword -t ensemble-simple .
docker build --build-arg cache=ensemble-2016.2.1.803.1 -t ensemble-simple .
docker run -d -p 57779:57772 -p 1979:1972 ensemble-simple
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5f8d2cb3745a ensemble-simple "/ ccontainermain -..." 18 seconds ago Up 17 seconds 0.0.0.0:1979->1972/tcp, 0.0.0.0.ln7779->57772/tcp keen_carson
Source: https://habr.com/ru/post/323746/
All Articles