Skip to content
Snippets Groups Projects
Verified Commit c3ae3553 authored by egon w. stemle's avatar egon w. stemle :robot:
Browse files

earthly-fy Dockerfile.postgres; use dsapce-version 2020.02.1:1.0 instead of git clone

parent 8d33a30d
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
git clone --depth 1 --branch ercc-master https://github.com/commul/clarin-dspace.git /tmp/dspace
cp /tmp/dspace/utilities/utilities.sql /tmp/sql/
cp /tmp/dspace/utilities/license_definition.txt /tmp/sql/
chmod -R a+w /tmp/sql/
perl -pi -e "s#afile :utildir '/license_definition.txt'#afile '/tmp/sql/license_definition.txt'#;" /tmp/sql/utilities.sql
#perl -pi -e 's/\$DSPACE_USER/$ENV{DSPACE_USER}/g;' /tmp/sql/utilities.sql
rm -rf /tmp/dspace
......@@ -2,8 +2,10 @@
# Dockerfile to build postgres for LINDAT Dspace container
# Based on Postgres
##############################################################################
ARG POSTGRES_VERSION=9.6
FROM gitlab.inf.unibz.it:4567/commul/docker/clarin-dspace/dspace-app/2020.02.1:1.0 as dspace-app
FROM postgres:$POSTGRES_VERSION
ARG POSTGRES_VERSION
......@@ -26,20 +28,23 @@ RUN apt-get update && apt-get install git
# copy int db script
RUN mkdir -p /docker-entrypoint-initdb.d
COPY commul-customization/init-dspace-dbs.sh /docker-entrypoint-initdb.d/
COPY init-dspace-dbs.sh /docker-entrypoint-initdb.d/
RUN chmod +x /docker-entrypoint-initdb.d/*
# FIXME: still needed?
# copy over modified config file
#COPY commul-customization/postgresql.conf /tmp/
#COPY commul-customization/updateConfig.sh /docker-entrypoint-initdb.d/_updateConfig.sh
# copy script generating utilities db
# Adapt license definitions file
RUN mkdir /tmp/sql/
COPY adapt_utilities_sql.sh /tmp/sql/
RUN /tmp/sql/adapt_utilities_sql.sh
COPY --from=dspace-app /app/utilities/utilities.sql /tmp/sql/
COPY --from=dspace-app /app/utilities/license_definition.txt /tmp/sql
RUN chmod -R a+w /tmp/sql/ && \
perl -pi -e "s#afile :utildir '/license_definition.txt'#afile '/tmp/sql/license_definition.txt'#;" /tmp/sql/utilities.sql
ARG LABEL_VERSION
ARG LABEL_BUILD_DATE
LABEL org.label-schema.version=$LABEL_VERSION \
org.label-schema.build-date=$LABEL_BUILD_DATE \
org.label-schema.vcs-url=$LABEL_VCS_URL
LABEL org.label-schema.version="$LABEL_VERSION"
LABEL org.label-schema.build-date="$LABEL_BUILD_DATE"
LABEL org.label-schema.vcs-url="$LABEL_VCS_URL"
# THIS IS A GENERATED FILE! See Earthfile.d/ for details.
#
# Usage: earthly --push --no-cache +docker
docker-from-docker:
FROM DOCKERFILE .
ARG DOCKER_BASE_URL="gitlab.inf.unibz.it:4567"
ARG EARTHLY_GIT_PROJECT_NAME # https://docs.earthly.dev/earthfile/builtin-args
ARG GIT_PROJECT_NAME="commul/docker/clarin-dspace"
ARG COMMUL_REGISTRY_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace/container_registry/"
ARG LABEL_VCS_URL="https://gitlab.inf.unibz.it/commul/docker/clarin-dspace"
ARG AUTHOR="Egon W. Stemle <egon.stemle@eurac.edu>"
ARG MAINTAINER="Egon W. Stemle <egon.stemle@eurac.edu>"
LABEL author="$AUTHOR"
LABEL maintainer="$MAINTAINER"
# An updated VERSION ARG triggers an update of the texlive installation
ARG EARTHLY_TARGET_TAG
ARG VERSION=$EARTHLY_TARGET_TAG
ARG EARTHLY_GIT_HASH
ARG GIT_HASH=$EARTHLY_GIT_HASH
ARG EARTHLY_TARGET_TAG_DOCKER
ARG TARGET_TAG_DOCKER=$EARTHLY_TARGET_TAG_DOCKER
ARG DOCKER_URL="$DOCKER_BASE_URL/$GIT_PROJECT_NAME/dspace-bundle/postgres"
LABEL org.label-schema.schema-version="1.0" \ # http://label-schema.org/rc1/
org.label-schema.version="$VERSION" \
org.label-schema.vcs-url="$LABEL_VCS_URL" \
org.commul.git-hash="$GIT_HASH" \
org.commul.registry-url="$COMMUL_REGISTRY_URL" \
org.commul.docker-url="$DOCKER_URL"
RUN echo $VERSION > /tmp/release
SAVE ARTIFACT --keep-ts /tmp/release AS LOCAL ./.release
SAVE IMAGE postgres:latest
SAVE IMAGE --push "$DOCKER_URL:latest"
SAVE IMAGE --push "$DOCKER_URL:$VERSION"
docker:
BUILD +docker-from-docker
# Set some sane defaults for docker
APT { GET { Assume-Yes "true"; }; };
APT { GET { Fix-Broken "true"; }; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment