setuid + wget simplification
This commit is contained in:
		
							parent
							
								
									26bbab959f
								
							
						
					
					
						commit
						6ca49d4865
					
				| @ -5,10 +5,8 @@ LAYER activemq/activemq | |||||||
| 
 | 
 | ||||||
| SCRIPT | SCRIPT | ||||||
|     # Download and install ActiveMQ |     # Download and install ActiveMQ | ||||||
|     wget http://archive.apache.org/dist/activemq/5.15.5/apache-activemq-5.15.5-bin.tar.gz -O /tmp/activemq.tgz |     wget http://archive.apache.org/dist/activemq/5.15.5/apache-activemq-5.15.5-bin.tar.gz -O - | tar xzf - -C /srv | ||||||
|     tar xf /tmp/activemq.tgz -C /srv |  | ||||||
|     mv /srv/apache-activemq-5.15.5 /srv/activemq |     mv /srv/apache-activemq-5.15.5 /srv/activemq | ||||||
|     rm -f /tmp/activemq.tgz |  | ||||||
| 
 | 
 | ||||||
|     # Create OS user |     # Create OS user | ||||||
|     addgroup -S -g 61616 activemq |     addgroup -S -g 61616 activemq | ||||||
|  | |||||||
| @ -10,10 +10,8 @@ SCRIPT | |||||||
|     apk --no-cache add --virtual .deps build-base autoconf gdbm-dev libressl-dev linux-headers readline-dev zlib-dev |     apk --no-cache add --virtual .deps build-base autoconf gdbm-dev libressl-dev linux-headers readline-dev zlib-dev | ||||||
| 
 | 
 | ||||||
|     # Download and unpack Ruby |     # Download and unpack Ruby | ||||||
|     wget http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.xz -O ruby.tar.xz |  | ||||||
|     mkdir -p /usr/src/ruby |     mkdir -p /usr/src/ruby | ||||||
|     tar xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1 |     wget http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.xz -O - | tar xJf - -C /usr/src/ruby --strip-components=1 | ||||||
|     rm ruby.tar.xz |  | ||||||
|     cd /usr/src/ruby |     cd /usr/src/ruby | ||||||
| 
 | 
 | ||||||
|     # Hackfix to suppress "Insecure world writable dir" warning |     # Hackfix to suppress "Insecure world writable dir" warning | ||||||
|  | |||||||
| @ -5,8 +5,7 @@ LAYER shared/tomcat | |||||||
| 
 | 
 | ||||||
| SCRIPT | SCRIPT | ||||||
|     # Install Tomcat 8 |     # Install Tomcat 8 | ||||||
|     wget http://mirror.hosting90.cz/apache/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.tar.gz -O /tmp/apache-tomcat-8.tgz |     wget http://mirror.hosting90.cz/apache/tomcat/tomcat-8/v8.0.53/bin/apache-tomcat-8.0.53.tar.gz | tar xzf - -C /srv | ||||||
|     tar xf /tmp/apache-tomcat-8.tgz -C /srv |  | ||||||
|     mv /srv/apache-tomcat-8.0.53 /srv/tomcat |     mv /srv/apache-tomcat-8.0.53 /srv/tomcat | ||||||
| 
 | 
 | ||||||
|     # Make catalina.sh available globally |     # Make catalina.sh available globally | ||||||
| @ -14,7 +13,6 @@ SCRIPT | |||||||
| 
 | 
 | ||||||
|     # Cleanup |     # Cleanup | ||||||
|     rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager |     rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager | ||||||
|     rm -f /tmp/apache-tomcat-8.tgz |  | ||||||
| RUN | RUN | ||||||
| 
 | 
 | ||||||
| COPY lxc-tomcat | COPY lxc-tomcat | ||||||
|  | |||||||
| @ -35,7 +35,7 @@ fi | |||||||
| # Populate database | # Populate database | ||||||
| lxc-execute -n ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini | lxc-execute -n ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini | ||||||
| lxc-execute -n ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini | lxc-execute -n ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini | ||||||
| lxc-execute -n ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-execute -n postgres -- psql | lxc-execute -n ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach -n postgres -- psql | ||||||
| chown -R 8003:8003 /srv/ckan/data | chown -R 8003:8003 /srv/ckan/data | ||||||
| 
 | 
 | ||||||
| # Create admin account | # Create admin account | ||||||
|  | |||||||
| @ -21,4 +21,4 @@ RUN | |||||||
| MOUNT /srv/postgres/data var/lib/postgresql | MOUNT /srv/postgres/data var/lib/postgresql | ||||||
| 
 | 
 | ||||||
| USER 5432 5432 | USER 5432 5432 | ||||||
| CMD /init.lxc.static -- /usr/bin/postgres -D /var/lib/postgresql | CMD s6-setuidgid 5432:5432 /usr/bin/postgres -D /var/lib/postgresql | ||||||
|  | |||||||
| @ -15,4 +15,4 @@ MOUNT /srv/redis/conf/redis.conf etc/redis.conf | |||||||
| MOUNT /srv/redis/data var/lib/redis | MOUNT /srv/redis/data var/lib/redis | ||||||
| 
 | 
 | ||||||
| USER 6379 6379 | USER 6379 6379 | ||||||
| CMD redis-server /etc/redis.conf | CMD s6-setuidgid 6379:6379 /usr/bin/redis-server /etc/redis.conf | ||||||
|  | |||||||
| @ -8,11 +8,9 @@ SCRIPT | |||||||
|     apk --no-cache add bash lsof |     apk --no-cache add bash lsof | ||||||
| 
 | 
 | ||||||
|     # Download and install Solr |     # Download and install Solr | ||||||
|     wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O /tmp/solr-6.5.1.tgz |  | ||||||
|     mkdir /opt |     mkdir /opt | ||||||
|     tar xzf /tmp/solr-6.5.1.tgz -C /opt/ |     wget http://archive.apache.org/dist/lucene/solr/6.5.1/solr-6.5.1.tgz -O - | tar xzf - -C /opt/ | ||||||
|     mv /opt/solr-6.5.1 /opt/solr |     mv /opt/solr-6.5.1 /opt/solr | ||||||
|     rm -f /tmp/solr-6.5.1.tgz |  | ||||||
| 
 | 
 | ||||||
|     # Create OS user |     # Create OS user | ||||||
|     addgroup -S -g 8983 solr |     addgroup -S -g 8983 solr | ||||||
| @ -29,4 +27,4 @@ RUN | |||||||
| MOUNT /srv/solr/data var/lib/solr | MOUNT /srv/solr/data var/lib/solr | ||||||
| 
 | 
 | ||||||
| USER 8983 8983 | USER 8983 8983 | ||||||
| CMD solr start -f | CMD s6-setuidgid 5432:5432 /usr/bin/solr start -f | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user