create=(file|dir), fix setup errors

This commit is contained in:
Disassembler 2018-09-14 18:13:11 +02:00
parent d957227d40
commit 1894893a6f
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
36 changed files with 64 additions and 70 deletions

View File

@ -20,7 +20,7 @@ EOF
COPY lxc
MOUNT /srv/activemq/data srv/activemq/data
MOUNT DIR /srv/activemq/data srv/activemq/data
USER 61616 61616
CMD /srv/activemq/bin/activemq console

0
activemq/setup/etc/init.d/activemq Normal file → Executable file
View File

View File

@ -11,7 +11,6 @@ ln -s ${SOURCE_DIR}/zz-extra/fix-apk /usr/bin/fix-apk
mkdir -p /var/lib/lxc/shared/alpine
wget https://github.com/gliderlabs/docker-alpine/raw/2bfe6510ee31d86cfeb2f37587f4cf866f28ffbc/versions/library-3.8/x86_64/rootfs.tar.xz -O - | tar xJf - -C /var/lib/lxc/shared/alpine
chmod 755 /var/lib/lxc/shared/alpine
touch /var/lib/lxc/shared/alpine/etc/resolv.conf
lxc-build ${SOURCE_DIR}/basic-runtimes/alpine.lxcfile
# Build shared overlays

View File

@ -21,9 +21,6 @@ RUN EOF
sed -i 's/\[security\]//' /srv/ckan-datapusher/src/datapusher/requirements.txt
pip install -r /srv/ckan-datapusher/src/datapusher/requirements.txt
# Prepare mountpoint for selfsigned certificate
touch /etc/ssl/services.pem
# Create OS user
addgroup -S -g 8004 ckandp
adduser -S -u 8004 -h /srv/ckan-datapusher -s /bin/false -g ckandp -G ckandp ckandp
@ -37,8 +34,8 @@ EOF
COPY lxc
MOUNT /etc/ssl/services.pem etc/ssl/services.pem
MOUNT /srv/ckan-datapusher/conf etc/ckan-datapusher
MOUNT /srv/ckan-datapusher/data srv/ckan-datapusher/data
MOUNT FILE /etc/ssl/services.pem etc/ssl/services.pem
MOUNT DIR /srv/ckan-datapusher/conf etc/ckan-datapusher
MOUNT DIR /srv/ckan-datapusher/data srv/ckan-datapusher/data
CMD execlineb -P /run

View File

@ -36,10 +36,6 @@ RUN EOF
pip install -r /srv/ckan/src/ckanext-spatial/pip-requirements.txt
pip install -r /srv/ckan/src/ckanext-dgvat-xls/requirements.txt
# Create mountpoints
mkdir /etc/ckan
mkdir /srv/ckan/storage
# Create OS user
addgroup -S -g 8003 ckan
adduser -S -u 8003 -h /srv/ckan -s /bin/false -g ckan -G ckan ckan
@ -51,8 +47,8 @@ RUN EOF
rm -rf /root/.cache
EOF
MOUNT /srv/ckan/conf etc/ckan
MOUNT /srv/ckan/data srv/ckan/storage
MOUNT DIR /srv/ckan/conf etc/ckan
MOUNT DIR /srv/ckan/data srv/ckan/storage
USER 8003 8003
CMD paster serve /etc/ckan/ckan.ini

View File

@ -51,7 +51,7 @@ RUN EOF
rm -rf /root/.bundle /root/.config /root/.npm
EOF
MOUNT /srv/crisiscleanup/conf srv/crisiscleanup/config
MOUNT DIR /srv/crisiscleanup/conf srv/crisiscleanup/config
USER 8005 8005
WORKDIR /srv/crisiscleanup

0
crisiscleanup/setup.sh Normal file → Executable file
View File

0
crisiscleanup/setup/etc/init.d/crisiscleanup Normal file → Executable file
View File

View File

@ -42,7 +42,7 @@ EOF
COPY lxc
MOUNT /srv/cts/conf srv/cts/cts/settings
MOUNT DIR /srv/cts/conf srv/cts/cts/settings
ENV DJANGO_SETTINGS_MODULE cts.settings.spotter
WORKDIR /srv/cts

View File

@ -27,6 +27,6 @@ EOF
COPY lxc
MOUNT /srv/frontlinesms/data srv/frontlinesms/.frontlinesms2
MOUNT DIR /srv/frontlinesms/data srv/frontlinesms/.frontlinesms2
CMD s6-svscan /etc/services.d

View File

@ -47,7 +47,7 @@ RUN EOF
rm -rf /usr/local/share/.cache
EOF
MOUNT /srv/gnuhealth/conf srv/gnuhealth/gnuhealth/tryton/server/config
MOUNT DIR /srv/gnuhealth/conf srv/gnuhealth/gnuhealth/tryton/server/config
USER 8008 8008
ENV PATH /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.15/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

View File

@ -43,7 +43,7 @@ EOF
COPY lxc
MOUNT /srv/kanboard/data srv/kanboard/data/files
MOUNT /srv/kanboard/conf/config.php srv/kanboard/config.php
MOUNT DIR /srv/kanboard/data srv/kanboard/data/files
MOUNT FILE /srv/kanboard/conf/config.php srv/kanboard/config.php
CMD s6-svscan /etc/services.d

View File

@ -12,7 +12,7 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
cat /var/lib/lxc/kanboard/kanboard/srv/kanboard/app/Schema/Sql/postgres.sql | lxc-attach -u 5432 -g 5432 postgres -- sh -c "PGPASSWORD=${KANBOARD_PWD} psql kanboard kanboard"
# Configure Kanboard
mkdir -p /srv/kanboard/conf /srv/kanboard/data/
mkdir -p /srv/kanboard/conf /srv/kanboard/data
chown -R 8009:8009 /srv/kanboard/data
envsubst <${SOURCE_DIR}/srv/kanboard/conf/config.php >/srv/kanboard/conf/config.php
export KANBOARD_ADMIN_USER=admin

View File

@ -15,8 +15,8 @@ RUN EOF
chown mysql:mysql /run/mysqld
EOF
MOUNT /srv/mariadb/conf etc/mysql
MOUNT /srv/mariadb/data var/lib/mysql
MOUNT DIR /srv/mariadb/conf etc/mysql
MOUNT DIR /srv/mariadb/data var/lib/mysql
USER 3306 3306
CMD mysqld

View File

@ -39,8 +39,8 @@ RUN EOF
rm /tmp/locale-cs.patch
EOF
MOUNT /srv/mifosx/conf/server.xml srv/tomcat/conf/server.xml
MOUNT /srv/mifosx/conf/context.xml srv/tomcat/webapps/fineract-provider/META-INF/context.xml
MOUNT FILE /srv/mifosx/conf/server.xml srv/tomcat/conf/server.xml
MOUNT FILE /srv/mifosx/conf/context.xml srv/tomcat/webapps/fineract-provider/META-INF/context.xml
USER 8012 8012
WORKDIR /srv/tomcat

View File

@ -24,7 +24,7 @@ RUN EOF
rm -f /tmp/motech.war
EOF
MOUNT /srv/motech/conf srv/tomcat/.motech
MOUNT DIR /srv/motech/conf srv/tomcat/.motech
USER 8013 8013
WORKDIR /srv/tomcat

View File

@ -40,7 +40,7 @@ EOF
COPY lxc
MOUNT /etc/ssl/services.pem usr/local/share/ca-certificates/services.crt
MOUNT /srv/opendatakit-build/conf/config.yml srv/opendatakit-build/config.yml
MOUNT FILE /etc/ssl/services.pem usr/local/share/ca-certificates/services.crt
MOUNT FILE /srv/opendatakit-build/conf/config.yml srv/opendatakit-build/config.yml
CMD s6-svscan /etc/services.d

View File

@ -30,9 +30,9 @@ RUN EOF
rm -rf /root/.gradle /root/.java /srv/opendatakit
EOF
MOUNT /srv/opendatakit/conf/server.xml srv/tomcat/conf/server.xml
MOUNT /srv/opendatakit/conf/jdbc.properties srv/tomcat/webapps/ROOT/WEB-INF/classes/jdbc.properties
MOUNT /srv/opendatakit/conf/security.properties srv/tomcat/webapps/ROOT/WEB-INF/classes/security.properties
MOUNT FILE /srv/opendatakit/conf/server.xml srv/tomcat/conf/server.xml
MOUNT FILE /srv/opendatakit/conf/jdbc.properties srv/tomcat/webapps/ROOT/WEB-INF/classes/jdbc.properties
MOUNT FILE /srv/opendatakit/conf/security.properties srv/tomcat/webapps/ROOT/WEB-INF/classes/security.properties
USER 8015 8015
WORKDIR /srv/tomcat

View File

@ -36,8 +36,8 @@ RUN EOF
rm -rf /root/.cache /root/.config /root/.node-gyp /root/.npm
EOF
MOUNT /srv/openmapkit/conf/settings.js srv/openmapkit/settings.js
MOUNT /srv/openmapkit/data srv/openmapkit/data
MOUNT FILE /srv/openmapkit/conf/settings.js srv/openmapkit/settings.js
MOUNT DIR /srv/openmapkit/data srv/openmapkit/data
USER 8007 8007
ENV NODE_ENV production

View File

@ -90,8 +90,8 @@ RUN EOF
rm -rf /root/.cache /root/.ox
EOF
MOUNT /srv/pandora/conf srv/pandora/conf
MOUNT /srv/pandora/data srv/pandora/data
MOUNT DIR /srv/pandora/conf srv/pandora/conf
MOUNT DIR /srv/pandora/data srv/pandora/data
WORKDIR /srv/pandora
CMD s6-svscan /etc/services.d

View File

@ -18,7 +18,7 @@ RUN EOF
chown postgres:postgres /run/postgresql
EOF
MOUNT /srv/postgres/data var/lib/postgresql
MOUNT DIR /srv/postgres/data var/lib/postgresql
USER 5432 5432
CMD postgres -D /var/lib/postgresql

View File

@ -14,7 +14,7 @@ RUN EOF
apk --no-cache add rabbitmq-server@edge
EOF
MOUNT /srv/rabbitmq/data var/lib/rabbitmq/mnesia
MOUNT DIR /srv/rabbitmq/data var/lib/rabbitmq/mnesia
USER 5672 5672
ENV HOME /usr/lib/rabbitmq

View File

@ -11,8 +11,8 @@ RUN EOF
apk --no-cache add redis
EOF
MOUNT /srv/redis/conf/redis.conf etc/redis.conf
MOUNT /srv/redis/data var/lib/redis
MOUNT FILE /srv/redis/conf/redis.conf etc/redis.conf
MOUNT DIR /srv/redis/data var/lib/redis
USER 6379 6379
CMD redis-server /etc/redis.conf

View File

@ -4,9 +4,9 @@ LAYER shared/libxml
LAYER shared/python2
LAYER sahana/sahana
MOUNT /srv/sahana/conf srv/web2py/applications/eden/models
MOUNT /srv/sahana/data/default srv/web2py/applications/eden/modules/templates/default
MOUNT /srv/sahana/data/databases srv/web2py/applications/eden/databases
MOUNT /srv/sahana/data/uploads srv/web2py/applications/eden/uploads
MOUNT DIR /srv/sahana/conf srv/web2py/applications/eden/models
MOUNT DIR /srv/sahana/data/default srv/web2py/applications/eden/modules/templates/default
MOUNT DIR /srv/sahana/data/databases srv/web2py/applications/eden/databases
MOUNT DIR /srv/sahana/data/uploads srv/web2py/applications/eden/uploads
CMD s6-svscan /etc/services.d

View File

@ -15,7 +15,7 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
mkdir -p /srv/sahana-demo/conf /srv/sahana-demo/data/databases /srv/sahana-demo/data/uploads /srv/sahana-demo/data/${TEMPLATE}
chown -R 8001:8001 /srv/sahana-demo/conf /srv/sahana-demo/data
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/models/. /srv/sahana-demo/conf
cp -rp /srv/web2py/applications/eden/modules/templates/${TEMPLATE}/. /srv/sahana-demo/data/${TEMPLATE}
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/modules/templates/${TEMPLATE}/. /srv/sahana-demo/data/${TEMPLATE}
# Configure Sahana
export SAHANADEMO_HMAC=$(head -c 18 /dev/urandom | base64)

View File

@ -59,9 +59,9 @@ RUN EOF
rm -r /root/.cache
EOF
MOUNT /srv/sahana/conf srv/web2py/applications/eden/models
MOUNT /srv/sahana/data/Spotter srv/web2py/applications/eden/modules/templates/Spotter
MOUNT /srv/sahana/data/databases srv/web2py/applications/eden/databases
MOUNT /srv/sahana/data/uploads srv/web2py/applications/eden/uploads
MOUNT DIR /srv/sahana/conf srv/web2py/applications/eden/models
MOUNT DIR /srv/sahana/data/Spotter srv/web2py/applications/eden/modules/templates/Spotter
MOUNT DIR /srv/sahana/data/databases srv/web2py/applications/eden/databases
MOUNT DIR /srv/sahana/data/uploads srv/web2py/applications/eden/uploads
CMD s6-svscan /etc/services.d

View File

@ -4,9 +4,9 @@ LAYER shared/libxml
LAYER shared/python2
LAYER sahana/sahana
MOUNT /srv/sahana/conf srv/web2py/applications/eden/models
MOUNT /srv/sahana/data/SAMBRO srv/web2py/applications/eden/modules/templates/SAMBRO
MOUNT /srv/sahana/data/databases srv/web2py/applications/eden/databases
MOUNT /srv/sahana/data/uploads srv/web2py/applications/eden/uploads
MOUNT DIR /srv/sahana/conf srv/web2py/applications/eden/models
MOUNT DIR /srv/sahana/data/SAMBRO srv/web2py/applications/eden/modules/templates/SAMBRO
MOUNT DIR /srv/sahana/data/databases srv/web2py/applications/eden/databases
MOUNT DIR /srv/sahana/data/uploads srv/web2py/applications/eden/uploads
CMD s6-svscan /etc/services.d

View File

@ -14,7 +14,7 @@ envsubst <${SOURCE_DIR}/createdb.sql | lxc-attach -u 5432 -g 5432 postgres -- ps
mkdir -p /srv/sambro/conf /srv/sambro/data/databases /srv/sambro/data/uploads /srv/sambro/data/SAMBRO
chown -R 8001:8001 /srv/sambro/conf /srv/sambro/data
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/models/. /srv/sahana-demo/conf
cp -rp /srv/web2py/applications/eden/modules/templates/SAMBRO/. /srv/sahana-demo/data/SAMBRO
cp -rp /var/lib/lxc/sahana/sahana/srv/web2py/applications/eden/modules/templates/SAMBRO/. /srv/sahana-demo/data/SAMBRO
# Configure SAMBRO
export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64)

View File

@ -45,7 +45,7 @@ RUN EOF
rm -rf /srv/seeddms/data/conf /srv/seeddms/www/ext/example
EOF
MOUNT /srv/seeddms/conf srv/seeddms/conf
MOUNT /srv/seeddms/data srv/seeddms/data
MOUNT DIR /srv/seeddms/conf srv/seeddms/conf
MOUNT DIR /srv/seeddms/data srv/seeddms/data
CMD s6-svscan /etc/services.d

View File

@ -14,8 +14,8 @@ cat ${SOURCE_DIR}/custom.sql | lxc-attach -u 5432 -g 5432 postgres -- psql seedd
# Copy existing files into persistent storage
mkdir -p /srv/seeddms/conf /srv/seeddms/data
cp -rp /var/lib/lxc/seddms/seeddms/srv/seeddms/conf/. /srv/seeddms/conf
cp -rp /var/lib/lxc/seddms/seeddms/srv/seeddms/data/. /srv/seeddms/data
cp -rp /var/lib/lxc/seeddms/seeddms/srv/seeddms/conf/. /srv/seeddms/conf
cp -rp /var/lib/lxc/seeddms/seeddms/srv/seeddms/data/. /srv/seeddms/data
chown -R 8010:8010 /srv/seeddms/data
# Configure SeedDMS

View File

@ -19,6 +19,8 @@ ${SOURCE_DIR}/cts/setup.sh
${SOURCE_DIR}/frontlinesms/setup.sh
${SOURCE_DIR}/gnuhealth/setup.sh
${SOURCE_DIR}/kanboard/setup.sh
${SOURCE_DIR}/mifosx/setup.sh
${SOURCE_DIR}/motech/setup.sh
${SOURCE_DIR}/opendatakit/setup.sh
${SOURCE_DIR}/opendatakit-build/setup.sh
${SOURCE_DIR}/openmapkit/setup.sh

View File

@ -28,9 +28,9 @@ EOF
COPY lxc
MOUNT /srv/sigmah/data srv/sigmah/data
MOUNT /srv/sigmah/conf/persistence.xml srv/tomcat/webapps/sigmah/WEB-INF/classes/META-INF/persistence.xml
MOUNT /srv/sigmah/conf/sigmah.properties srv/tomcat/webapps/sigmah/WEB-INF/classes/sigmah.properties
MOUNT DIR /srv/sigmah/data srv/sigmah/data
MOUNT FILE /srv/sigmah/conf/persistence.xml srv/tomcat/webapps/sigmah/WEB-INF/classes/META-INF/persistence.xml
MOUNT FILE /srv/sigmah/conf/sigmah.properties srv/tomcat/webapps/sigmah/WEB-INF/classes/sigmah.properties
USER 8011 8011
WORKDIR /srv/tomcat

View File

@ -36,7 +36,7 @@ sed -i "s|§UserFirstName§|${SIGMAH_ADMIN_USER}|g" /tmp/sigmah-newOrganizationL
sed -i "s|§UserLocale§|en|g" /tmp/sigmah-newOrganizationLaunchScript.sql
sed -i "s|\$2a\$10\$pMcTA1p9fefR8U9NoOPei.H0eq/TbbdSF27M0tn9iDWBrA4JHeCDC|${SIGMAH_ADMIN_HASH}|" /tmp/sigmah-newOrganizationLaunchScript.sql
cat /tmp/sigmah-MinimumDataKit.sql | lxc-attach postgres -- sh -c "PGPASSWORD=${SIGMAH_PWD} psql -U sigmah sigmah"
cat /tmp/sigmah-newOrganizationLaunchScript.sql | lxc-attach postgres -- sh -c "PGPASSWORD=${SIGMAH_PWD} postgres psql -U sigmah sigmah"
cat /tmp/sigmah-newOrganizationLaunchScript.sql | lxc-attach postgres -- sh -c "PGPASSWORD=${SIGMAH_PWD} psql -U sigmah sigmah"
rm -f /tmp/sigmah-MinimumDataKit.sql /tmp/sigmah-newOrganizationLaunchScript.sql
vmmgr update-login sigmah "${SIGMAH_ADMIN_EMAIL}" "${SIGMAH_ADMIN_PWD}"

View File

@ -23,7 +23,7 @@ EOF
COPY lxc
MOUNT /srv/solr/data var/lib/solr
MOUNT DIR /srv/solr/data var/lib/solr
USER 8983 8983
CMD solr start -f

View File

@ -33,8 +33,8 @@ RUN EOF
rm aura.patch
EOF
MOUNT /srv/ushahidi/conf/env srv/ushahidi/platform/.env
MOUNT /srv/ushahidi/conf/config.json srv/ushahidi/config.json
MOUNT /srv/ushahidi/data srv/ushahidi/platform/application/media/uploads
MOUNT FILE /srv/ushahidi/conf/env srv/ushahidi/platform/.env
MOUNT FILE /srv/ushahidi/conf/config.json srv/ushahidi/config.json
MOUNT DIR /srv/ushahidi/data srv/ushahidi/platform/application/media/uploads
CMD s6-svscan /etc/services.d

View File

@ -19,8 +19,8 @@ lxc.rootfs.path = {rootfs}
# Mounts
lxc.mount.entry = shm dev/shm tmpfs rw,nodev,noexec,nosuid,relatime,mode=1777,create=dir 0 0
lxc.mount.entry = /etc/hosts etc/hosts none bind 0 0
lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind 0 0
lxc.mount.entry = /etc/hosts etc/hosts none bind,create=file 0 0
lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind,create=file 0 0
{mounts}
# Init
@ -94,7 +94,7 @@ class LXCImage:
self.copy_files(srcdst[1], srcdst[2] if len(srcdst) == 3 else '')
elif line.startswith('MOUNT'):
mount = line.split()
self.add_mount(mount[1], mount[2])
self.add_mount(mount[1], mount[2], mount[3])
elif line.startswith('ENV'):
env = line.split()
self.add_env(env[1], env[2])
@ -145,8 +145,8 @@ class LXCImage:
dst = os.path.join(self.layers[-1], dst)
copy_tree(src, dst)
def add_mount(self, src, dst):
self.mounts.append('lxc.mount.entry = {} {} none bind 0 0'.format(src, dst))
def add_mount(self, type, src, dst):
self.mounts.append('lxc.mount.entry = {} {} none bind,create={} 0 0'.format(src, dst, type.lower()))
self.rebuild_config()
def add_env(self, key, value):