From 82eb6b5d9fb854fd14c0d6c98ead980a3ded1b1e Mon Sep 17 00:00:00 2001 From: Joel Anderson Date: Wed, 28 Sep 2016 13:47:41 -0400 Subject: [PATCH] sed install script --- dataverse.json | 2 +- docker/glassfish/Dockerfile | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/dataverse.json b/dataverse.json index c50142f..bf88c71 100644 --- a/dataverse.json +++ b/dataverse.json @@ -1250,7 +1250,7 @@ "\\n", "\\n", "\\n\" | docker run -i --name=dataverse-init ", { "Ref": "DockerRepoStringGlassfish" }, - " bash -c \"cd dvinstall; sed -i 's/NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN/NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; grant $CONFIG_DEFAULTS{'POSTGRES_USER'} to postgres;/' install; ./install\"\n", + " bash -c \"cd dvinstall; ./install\"\n", " docker stop dataverse-init\n", " fleetctl submit /home/core/glassfish.service\n", " curl http://127.0.0.1:2379/v2/keys/dvninit -XPUT -d value=done\n", diff --git a/docker/glassfish/Dockerfile b/docker/glassfish/Dockerfile index 3ccda26..f7a4071 100644 --- a/docker/glassfish/Dockerfile +++ b/docker/glassfish/Dockerfile @@ -29,12 +29,24 @@ RUN yum install -y java-1.8.0-openjdk-devel unzip perl postgresql #RUN alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java # Install glassfish -RUN curl -L http://download.oracle.com/glassfish/4.1/release/glassfish-4.1.zip -o /glassfish-4.1.zip && cd /usr/local && unzip /glassfish-4.1.zip && rm /glassfish-4.1.zip +RUN curl -L http://download.oracle.com/glassfish/4.1/release/glassfish-4.1.zip -o /glassfish-4.1.zip \ + && cd /usr/local \ + && unzip /glassfish-4.1.zip \ + && rm /glassfish-4.1.zip + # Patch Weld for dataverse -RUN rm /usr/local/glassfish4/glassfish/modules/weld-osgi-bundle.jar && cd /usr/local/glassfish4/glassfish/modules/ && curl -L http://central.maven.org/maven2/org/jboss/weld/weld-osgi-bundle/2.2.10.SP1/weld-osgi-bundle-2.2.10.SP1-glassfish4.jar -o weld-osgi-bundle-2.2.10.SP1-glassfish4.jar +RUN rm /usr/local/glassfish4/glassfish/modules/weld-osgi-bundle.jar \ + && cd /usr/local/glassfish4/glassfish/modules/ \ + && curl -L http://central.maven.org/maven2/org/jboss/weld/weld-osgi-bundle/2.2.10.SP1/weld-osgi-bundle-2.2.10.SP1-glassfish4.jar -o weld-osgi-bundle-2.2.10.SP1-glassfish4.jar # Install dataverse, jq, jdbc driver, and jhove config -RUN curl -L https://github.com/IQSS/dataverse/releases/download/v4.5/dvinstall.zip -o /dvinstall.zip && unzip dvinstall.zip && rm dvinstall.zip && curl -L http://stedolan.github.io/jq/download/linux64/jq -o /usr/bin/jq && chmod u+x /usr/bin/jq && cp /dvinstall/pgdriver/postgresql-9.1-902.jdbc4.jar /usr/local/glassfish4/glassfish/lib/ && cp /dvinstall/jhove.conf /usr/local/glassfish4/glassfish/domains/domain1/config +RUN curl -L https://github.com/IQSS/dataverse/releases/download/v4.5/dvinstall.zip -o /dvinstall.zip \ + && unzip dvinstall.zip \ + && rm dvinstall.zip \ + && curl -L http://stedolan.github.io/jq/download/linux64/jq -o /usr/bin/jq \ + && chmod u+x /usr/bin/jq \ + && cp /dvinstall/pgdriver/postgresql-9.1-902.jdbc4.jar /usr/local/glassfish4/glassfish/lib/ \ + && cp /dvinstall/jhove.conf /usr/local/glassfish4/glassfish/domains/domain1/config # Specify volume for shared storage VOLUME /data/dvn:/usr/local/dvn/data @@ -42,8 +54,9 @@ VOLUME /data/dvn:/usr/local/dvn/data # COPY run_dataverse.sh /run_dataverse.sh RUN chmod u+x run_dataverse.sh -COPY install /dvinstall/install -RUN chmod u+x /dvinstall/install +#COPY install /dvinstall/install +#RUN chmod u+x /dvinstall/install +RUN sed -i -e "s/. \x22\x27 NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN\x22;/. \x22\x27 NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; grant $CONFIG_DEFAULTS{\x27POSTGRES_USER\x27} to postgres\x22;/g" /dvinstall/install # CMD /run_dataverse.sh